title: When to use System.Threading.ThreadPool and when one of the many custom thread pools?
body: <p>I'm working on creating an async handler for ASP.NET that will execute a slow stored procedure. I think I understand that to gain additional throughput on a mixed load of slow and fast pages, the slow page needs to be executed on a <em>thread pool separate from the one the ASP.NET uses</em>, otherwise the async pattern will cause double the number of scarce threads to be used (correct me if I'm wrong).</p>
  
  <p>So I have found <a href="http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx" rel="nofollow"><code>System.Threading.ThreadPool</code></a> - it looks like it should do the trick, but...</p>
  
  <p>The various tutorials on the net such as <a href="http://haacked.com/archive/2009/01/09/asynchronous-fire-and-forget-with-lambdas.aspx" rel="nofollow">this one</a> which uses this <a href="http://www.koders.com/csharp/fidD26A22C3944C4B6D66D2DA45BA3D502389B154CB.aspx?s=file:semaphore.cs" rel="nofollow">custom pool</a>, the one in <a href="http://www.yoda.arachsys.com/csharp/miscutil/" rel="nofollow">John Skeet's MiscUtils</a>, and the custom thread pool referenced in this <a href="http://msdn.microsoft.com/en-us/magazine/cc164128.aspx" rel="nofollow">tutorial about async patterns</a>.</p>
  
  <p><code>System.Threading.ThreadPool</code> has existed since 1.1 - why do people routinely feel the need to write a brand new one? Should I avoid using <code>System.Threading.ThreadPool</code>?</p>
  
  <p>I'm a rank beginner when it comes to threading, so go easy on the undefined jargon.</p>
  
  <p><strong>UPDATE</strong>. The stored procedure to be executed will not necessarily be MS-SQL and will not necessarily be able to use a built-in async method such as <code>BeginExecuteNonQuery()</code>.</p>