[Mono-list] threads and Async Socket methods

Gonzalo Paniagua Javier gonzalo@ximian.com
Fri, 07 May 2004 20:02:48 +0200

El vie, 07-05-2004 a las 18:09, Kele Turnipseed escribió:
> I am not sure if the problem I am experiencing is the same as yours, but I
> will explain what appears to be happening to me.
> I have a similar program: a TCP server with lots of data being relayed
> between the clients.  I am using async for accepting, sending and receiving.
> When I have about 20 async calls which have not returned for a while, all
> subsequent calls lock up until the first calls finish.  This happens a lot
> when a client stops acknowledging packets, but is not registering as
> disconnected.  I can see a large send queue value in netstat when this
> happens.

The default socket implementation for asynchronous methods uses the
threadpool, which, by default, has 25 worker threads. If you use all of
them bad things may happen. I wrote something about that: