Solved

Shutting down a thread pool contained in a windows service.

Posted on 2003-12-04
1
312 Views
Last Modified: 2010-04-16
I'm building a windows service in c# that has a thread pool being used to process messages from an MSMQ.  A new thread is created by a manager thread to process each message fed by an asyncronous reader reading the queue.

My question is... how do I allow the user to shutdown the thread pool in a graceful manner?

My current thinking is that I stop the reader and then to wait until all threads in the pool have completed.  The bit I'm stuck on exactly how to do this so would very much appreciate some assistance.
0
Comment
Question by:neviljer
1 Comment
 
LVL 24

Accepted Solution

by:
shivsa earned 250 total points
ID: 10181278
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem!!! 8 37
Switching Visual Studio 2015 to normal debug display 3 39
Dynamics CRM Plugin Query TotalRecordCount returning -1 13 46
Change to file doesn't show up 16 57
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question