Re: Need an advice with this (multithread)

From: Steve C. Orr [MVP, MCSD] (Steve_at_Orr.net)
Date: 02/01/05


Date: Tue, 1 Feb 2005 10:06:16 -0800

ASP.NET threads that run for too long (hours) tend to get orphaned and could
be collected by the garbage collector before they've completed. An EXE is
its own process so I believe it does not have this risk. Windows Services
are also not at risk. This is a matter of using the right tool for the job,
and ASP.NET is not it (in this case.)

-- 
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message 
news:OsP3wZFCFHA.1408@TK2MSFTNGP10.phx.gbl...
>> I suggest you have ASP.NET launch an EXE to do this or queue up a windows
> launch another process implicitly uses a thread so there is no gain here, 
> in fact there is more overhead with launching a process than firing a 
> thread to do the long running query.
>
>>> Is this ok?
> It's ok up to the point where the number of users using the application is 
> low, otherwise you run the risk of spawning too many threads.
>
> -- 
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> The Microsoft Office Web Components Black Book with .NET
> Now Available @ http://tinyurl.com/27***
> ----------------------------------------------------------
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@Orr.net> wrote in message 
> news:%232AKytACFHA.3376@TK2MSFTNGP12.phx.gbl...
>> ASP.NET was not meant for such lengthy operations.
>> I suggest you have ASP.NET launch an EXE to do this or queue up a windows 
>> service to handle the task.  Perhaps a flag can be set in a database when 
>> the process is complete.
>>
>> Here's more information on Windows Services:
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvssamp/html/vbcs_CreatingaWindowsService.asp
>>
>> -- 
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>>
>> "Ekempd" <Ekempd@discussions.microsoft.com> wrote in message 
>> news:169A5461-CB73-4B53-8CB0-C7D0309BA49A@microsoft.com...
>>> Hi I need some advice about this situation an how I'm current handling 
>>> it
>>>
>>> I hava a ASP.NET solution that in some point start multiples lenghty
>>> verification agains diferent databases, my big challenge is that the 
>>> user
>>> click in a button "start process"
>>> and close the explorer windows... and in the backgroud all the required
>>> query are executed, when the user is back, maybe two hours late the 
>>> process
>>> is finish ..
>>>
>>> I currently hadlle this (in a developing enviroment) creating a thread 
>>> when
>>> the user click the star button and this thread start some news thread 
>>> for
>>> other operation, and seems to work fine,
>>>
>>> I create the thread using just this:
>>>
>>> Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)
>>>
>>> Is this ok?
>>>
>>
>>
>
> 

Loading