Your thread operates under some condition, right?
On each loop cycle this condition is begin checked, and if it is true thread
loop continues ( thread is going on )
and if not - loop is exited ( thread shutdowns ).
You can make this condition "visible" for the whole class that is you can
specify this condition in
application_end routine to false and thread will "naturally" exit.
About cleanup it depends what actions are performed in the thread, that is
if you use some unmanaged resources ( db connections, socket connections,
interop etc ) you have to either call Dispose or Close, or Shutdown. It
depends on the type of resources your thread is using.
--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com
"gl" <gl@discussions .microsoft.com> wrote in message
news:EC******** *************** ***********@mic rosoft.com...
I currently have an asp.net web app that starts a thread in the global.asax
app start method. THe thread then runs for the duration of the app's life,
changing data in the background.
My question is what cleanup do i have to do for the thread when the app is
stopped? Do i need to do anything at all? Should I put a threadname.abor t
in
the application_end ? I wasn't sure what cleanup to do.
Thanks.