Prevent worker process from recycling when foreground thread is executing.

  • Thread starter Thread starter Marcel van den Hof
  • Start date Start date
M

Marcel van den Hof

Dear all,

Is there any way to prevent the ASP.NET worker process from recycling
the worker process when a thread is being executed on the foreground
(IsBackground=false).

I'd also like to know if there a way for a foreground thread to detect
if the worker process is being recycled?

It seems that when a worker process recycles (under IIS 5.0) a thread
simply gets killed and there is no way for the thread to find that
out.

Thanks for your help everyone.

Kind regards,

Marcel van den Hof
 
I appreciate your response Steven.

I completely understand that using a Windows Service would not cause
threads to be terminated unexpectedly.

However I am still interested in understanding the precise behaviour
of how the worker process recycles a thread with the IsBackground
property set to true. (and how to prevent this or pick this up in the
thread)

Thanks for your input.

Kind regards,

Marcel van den Hof
 
when a recyle happens, the asp.net worker process actually exits, thus
killing all threads and releasing all memory (managed or unmanged). the
point of a recycle is to recover from runaway thread or memory leaks.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top