[Mono-devel-list] PATCH: reworked async IO for Socket

James Mansion james at wgold.demon.co.uk
Sat Apr 9 03:40:55 EDT 2005


>Miguel told me that the performance issue will appear when, say,
>thousands of sockets have to be passed to/from kernel/user space.

And you believed him?  Why? ;-)

There has been plenty of work on this sort of thing - google
for c10k.

The bottom line is that more modern interfaces like kqueue on
*BSD and /dev/epoll make this problem (of the socket passing)
go away.

I might suggest using a slight modification where you have an
io driver (or perhaps drivers for read, write, connect) that
wait on kqueue et al and perform the socket read/write calls
with access to the buffers, and then delegate to thrad pool
for completion routines.  I think you will easily keep the
kernel buffers filled this way, and don't need to parallelise
the actual calling of read or write further.

For >1GBe that might not hold, so just have a small
(configurable) number of such drivers and hash the sockets
between them.

James





More information about the Mono-devel-list mailing list