April 24, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Create Your Own Thread Pool, Page 3

  • 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.

 

 


Sitemap | Contact Us

Rocket Fuel