The ASP.NET host provides a single thread pool per process. So if you're using ThreadPool
, then it's taking from the same pool that is drawn from for server requests.
That said, if you're starting background operations that are independent from a single client request, then you should be using a Win32 service, web service, message queue system, or something similar. Running "background" threads in ASP.NET goes against the entire architecture of IIS; it's much easier to scale properly and do other IT work (e.g., restarting app pools) if you maintain the stateless nature of HTTP.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…