[Mono-list] threads and Async Socket methods
P Oscar Boykin
boykin@pobox.com
Fri, 7 May 2004 11:59:46 -0700
--R+My9LyyhiUvIEro
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Thanks for pointing out this article.
This appears to be my problem:
When I have enough sockets waiting on a BeginReceive, I cannot do
any other Async method. I guess the worker queue gets filled with the
BeginReceive calls, and then BeginSend calls cannot get through.
For our work, the limit of 25 ThreadPool threads waiting on tcp sockets
is just not going to work.
It seems like there are two options here:
1) Avoid Async socket operations for systems that need to scale to large
numbers. Prefer Select I guess.
2) Reimplement the Async sockets to make sure they always use native
operating system asynchronous facilities.
I think you already said that in the 2.6 kernel, the Async Sockets use
the posix aio interface.
It seems like in linux 2.4 there is a means to get the kernel to send
signals a socket is ready for IO:
http://www.kegel.com/c10k.html#nb.sigio
What would be the issues with doing a 2.4 implementation using the
signals mechanism?
Best,
Oscar
On Fri, May 07, 2004 at 08:02:48PM +0200, Gonzalo Paniagua Javier wrote:
> 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:
> http://primates.ximian.com/~gonzalo/mono/blog/archives/2003_10.html
>=20
> -Gonzalo
>=20
>=20
> _______________________________________________
> Mono-list maillist - Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
--=20
boykin@pobox.com http://pobox.com/~boykin jabber: johnynek@jabber.org
fingerprint=3DD250 4AD9 4544 B7D2 A17C 911D D608 D387 6718 D75F
Understand Free Software: http://www.gnu.org/philosophy/philosophy.html
--R+My9LyyhiUvIEro
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAm9yi1gjTh2cY118RAn+mAJ0eTmNJdnSFQ9UAeSqJ439FjOi9RwCfVtxi
EXoES1ZdptZJZpmJv0dY22Y=
=jDqX
-----END PGP SIGNATURE-----
--R+My9LyyhiUvIEro--