Solved

Shutting down a thread pool contained in a windows service.

Posted on 2003-12-04
1
310 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Close form "before" open 3 40
converto datetime always changes format 9 35
C# Gridview 1 31
Release Dynamically Allocated Memory in C# 3 25
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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