- _itemQueuedEvent will be set when a new item has been queued and requests processing
- _stopAll will be signaled to terminate all of the threads in the thread pool
Friday, July 16, 2010
A ThreadPool Class
This is a basic implementation of a thread pool written in .NET 2.0 ThreadPool The class AliGInterview.Threading.ThreadPool is a very basic implementation of a thread pool class. This class is responsible for accepting the request from client codes, queue the requests and informing the running threads to pick the newly arrived requests when they are done with their current task Clients have to call the method QueueUserWorkItem to queue their process requests. This method follows the same syntax as its counterpart in System.Threading.ThreadPool of .NET 2.0 and is the only public method of the classSignaling There are two waiting handles that are responsible for orchestrating the queue signaling and termination signaling
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment