dcsimg
August 19, 2018
Hot Topics:

Create Your Own Thread Pool

  • November 10, 2008
  • By Chris Bennett
  • Send Email »
  • More Articles »

Conclusion

Consisting of only a couple of classes, the preceding thread pool is a generic thread pool similar to the built-in System.Threading.ThreadPool class, designed for general use. The above thread pool differs from the built-in class in that it will very quickly ramp up the number of threads to accommodate the workload and slowly close threads when idle. In addition, you have full control over what is processed by the thread pool and you can create multiple thread pools. By incorporating a thread pool into your application, you will allow your application to take better advantage of multiple processing cores. However, remember not to create an excessive number of thread pools, because each instance will have the overhead of a single management thread plus the minimum number of worker threads.

Download the Code

You can download the code that accompanies the article here.

About the Author

Chris Bennett is a manager with Crowe Horwath LLP in the Indianapolis office. He can be reached at 317.208.2586 or chris.bennett@crowehorwath.com.





Page 3 of 3



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date