Controlling ThreadPool Threads

G

Guest

Hello

Is there a recommended way to safely shutdown ThreadPool Threads

I am creating a windows serivce that uses the ThreadPool class. When I receive a Stop command from the service control manager I want identify which ThreadPool threads are running and either stop them or at least wait for them to finish their tasks.
 
J

James P

Use ManualResetEvent.

James P
Chris Stransky said:
Hello,

Is there a recommended way to safely shutdown ThreadPool Threads?

I am creating a windows serivce that uses the ThreadPool class. When I
receive a Stop command from the service control manager I want identify
which ThreadPool threads are running and either stop them or at least wait
for them to finish their tasks.
 

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

Top