Default ThreadPool size in .net 2.0 SP1

ThreadPool in .net framework , as the name applies ,  a pool of thread, that an application can use to execute diiferent code section concurrently, instead of creating its own thread. Application borrows thread from thread pool to exectue via ThreadPoolQueueUserWorkItem , which queues the request , the request is furnished when a thread is available in the thread pool. After execution , the thread is returned to the pool so other requests in the queue can use it. Thread pool are mostly utilized in Asynchronous Programming model.

In the release of .net framework 2.0 , the default max no. of available threads in the pool was 25 per processor. You can set it to a different value, but it is usually discouraged to set to a value too higher, and you may need to reconsider your application (profiling etc) , since it may lead to starvation of the threads. With .net 2.0 SP1 , this max no of thread has been elevated to 250 threads per cpu . Joe Duffy has discussed about necessity of this higher limit in his post.

well I think it is not a good decision, setting a default 250 limit, will result in larger startup time to intialize the thread pool. Though you can set your limit to a lower level,(do it as early as you can). But I think this feauter should be an opt-in feature , instead of an opt-out (as .net framework 2.0 already presents it).




2 responses to “Default ThreadPool size in .net 2.0 SP1

  1. Pingback: C#: BeginInvoke « Tutorien

  2. The HTC Desire is one of those phones which comfortably doubles up as both a versatile smartphone as well as
    a fashion statement in mobile phone form. Flight Tracker
    Thanks to this app, one can track every aspect of domestic
    and international flights with real-time updates and zoomable maps.
    What Amason is to print and e – Books, Audible iss for audio content.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s