title: ThreadPool max threads
body: <p>I've got some trouble with .NET's ThreadPool (.NET 4).</p>
  
  <p>I've read that by default .NET has a limit of 25 threads per processor, but according to forum posts on SO and on other places, I can increase the limit with the below code.</p>
  
  <pre><code>void SetThreads(int threads)
  {
      ThreadPool.SetMaxThreads(threads, threads);
      ThreadPool.SetMinThreads(threads, threads);
  }
  </code></pre>
  
  <p>However, when I set the above to some arbitrarily high number, for example, 2000, and queue ~1000 items, I still only have ~33 threads running (.NET CLR takes ~5 threads), and <code>ThreadPool.GetAvailableThreads()</code> returns 1971 threads remaining.</p>
  
  <p>Why doesn't the code above work?</p>