RE: Thread Pool in ISS Question by DavidWilliams
DavidWilliams
Thu Jul 01 12:39:01 CDT 2004
As I understand it, you are quite correct. IIS hosts it's own copy of the CLR (which handles the threadpool.) Each copy of the CLR has one ThreadPool, of which there is 25 worker threads per CPU. These worker threads are used by application, async requests, and internally by the CLR. If every one of these worker threads are in use, any additional requests (from any source) will go onto a queue and awaits a return of a thread to the pool. It the items that are processing on the threads are not real short, you may end up noticing a delay in processing.
Now, the CLR and MOST async calls are over very quickly, so you would have to seriously overload the system to see problems if those are the only onces running from the ThreadPool. If on the other hand, you are using the ThreadPool explicatly or from an async call that you KNOW will be long running, then you can run into problems.
What I have done in the past when handling this type of problem is to create my own thread in the Async call. That thread then does the work, while returning the async thread to the pool.
HTH
--
David Williams, VB.NET MVP
"Bill" wrote:
> If running a .Net application under IIS with 50 simultaneous requests and
> each request is trying to use an ASYNC socket what happens to the thread
> pool for that application? It appears that there is a maximum of 50 worker
> threads in the pool, if all those 50 threads are processing requests how
> will the new ASYNC threads get created? Won't this cause a deadlock while
> waiting for an free thread, which never occurs?
>
> Can someone explain to me how this works?
>
> --
> Bill
>
>
>