Asynchronous pages in the ASP.NET framework - where are the other threads and how is it reattached?

Posted by rkrauter on Stack Overflow See other posts from Stack Overflow or by rkrauter
Published on 2010-04-04T18:14:02Z Indexed on 2010/04/04 18:33 UTC
Read the original article Hit count: 613

Sorry for this dumb question on Asynchronous operations. This is how I understand it.

IIS has a limited set of worker threads waiting for requests. If one request is a long running operation, it will block that thread. This leads to fewer threads to serve requests.

Way to fix this - use asynchronous pages. When a request comes in, the main worker thread is freed and this other thread is created in some other place. The main thread is thus able to serve other requests. When the request completes on this other thread, another thread is picked from the main thread pool and the response is sent back to the client.

1) Where are these other threads located?

2) IF ASP.NET likes creating new threads, why not increase the number of threads in the main worker pool - they are all running on the same machine anyway?

3) If the main thread hands off a request to this other thread, why does the request not get disconnected? It magically hands off the request to another worker thread somewhere else and when the long running process completes, it picks a thread from the main worker pool and sends response to the client. I am amazed...but how does that work?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc