Combine more operation within one system call: to do it, or not to do it?

Igor Sysoev is at rambler-co.ru
Tue Sep 27 05:31:26 PDT 2005


On Mon, 19 Sep 2005, Xin LI wrote:

> It seems that Microsoft has recently revised several of their APIs.  One
> example is their ConnectEx(), as found in documentation [1].  The
> implementation is not so complex that it just combines more operation
> within one system call, however, this can reduce some unnecessary
> context switches as it's now possible to do more things within one
> system call.  (For instance, when you connect to a server, you usually
> want to send some data as request).
>
> Shall we do something similar?  Or do we already done something similar?
>
> [1]
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/connectex_2.asp

Actually, ConnectEx() was implemented to allow to post an asynchronous
connect operations to the i/o completion ports.  There is no API to
implement high perfomance proxy in Windows NT and 2000.  You have to
use non-blocking connect() and then pass the socket to special helper
threads that wait in WSAWaitForMultipleEvents() when the sockets would
be connected.  Each thread could handle up to 63 sockets only.


Igor Sysoev
http://sysoev.ru/en/


More information about the freebsd-performance mailing list