Re: Thread won't start?

Tech-Archive recommends: Fix windows errors by optimizing your registry



not quite true.

the lifetime of a thread is tied to the process. if the hosting appdomain is
unloaded, an abort request is sent to the thread by the clr

if you use create thread as the example did, a new process thread is
created, a thread is not taken from the clr thread pool. you need to use clr
thread pool api to do this.


-- bruce (sqlwork.com)


"Brock Allen" <ballen@xxxxxxxxxxxxxxxxx> wrote in message
news:1057108632585983337812500@xxxxxxxxxxxxxxxxxxxxxxx
> I'm not sure where you got this information, except perhaps you're
> confusing this with other environments.
>
>> The lifetime of a child thread is limited to the lifetime of the
>> parent thread.
>
> This is not correct. If a parent thread is terminated it does not
> implicitly affect a child thread.
>> As an ASP.Net Page instance lasts for several
>> milliseconds, your thread is dying almost immediately, when the Page
>> class is unloaded.
>
> ASP.NET threads are not created and terminated for each request nor are
> their lifetimes tied to the lifetime of the page (or handler). Threads are
> are drawn from the CLR thread pool to execute requests in ASP.NET. Once
> the request is done the thread is returned to the CLR thread pool. The
> thread pool may, over time, create and destroy threads, but this is based
> upon load upon the server. It is not tied to each request and/or page.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>


.



Relevant Pages

  • Re: Thread wont start?
    ... an abort request is sent to the thread by the ... a thread is not taken from the clr thread pool. ... "ASP.NET threads are not created and terminated for each request nor are ... their lifetimes tied to the lifetime of the page. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Surprising threading issue
    ... Although ASP.NET will process A and B's request in separate threads, ... I do understand your approach using the queue but maybe the static ... Using a static variable tracking time, you wind up with a queued thread pool item practically immediately for every single possible work item. ... But it seems to me it's better to throttle that work more locally (this may be less of an issue with Jon's thread pool class...I haven't looked at it, but the mere fact that it's instantiated rather than basically being a static class suggests you can get away with the more-global throttling with his...even so, I'd prefer the more direct approach, personally). ...
    (microsoft.public.dotnet.framework)
  • Re: Thread wont start?
    ... I was indeed confusing this with other environments. ... >> The lifetime of a child thread is limited to the lifetime of the ... > the request is done the thread is returned to the CLR thread pool. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Multi-threading architecture
    ... And when i check thread pool and find a thread ... >> to be in the waiting state, the waiting state is released and the ... Don't pick a thread to hand the request to. ... > If you have a bunch of truck drivers milling around the office, ...
    (comp.programming.threads)
  • Re: when is the threadpool used in remoting calls?
    ... How much remoting long time requests can be ... In a context of which a thread the client request is being processed on the ... working thread or completon port thread? ... >>threads in the thread pool (ThreadPool.GetAvailableThreads, ...
    (microsoft.public.dotnet.framework.remoting)