Threading shutdown question

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

I have a windows service that starts up about 6 class modules, that each
start a worker thread. When I stop my windows service, will these classes
and threads go away? Or do I need to explicitly stop each of them?
 
it is recommended to stop each of them (structure wise). Additionnally, it
would be good not to make your threads sleep for too long, because they will
not exit before the sleep method is done, so if you make the thread sleep
for 60,000ms, then the thread will not exit until the minute of sleep is
done. So it can slowdown the closing of your service by quite a lot.

I hope it helps

ThunderMusic
 
Hi,

The threads should exit gracefully if:

Thread.IsBackground = True

Dick
--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 

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

Similar Threads

Another Service/Thread question. 3
Using Classes with threads 4
multi threaded status query 3
Progress bar update from worker thread 5
Connection limit 10
Thread question 3
Thread Question 6
Handling Threads 5

Back
Top