cygwin performance problem

Corinna Vinschen vinschen at
Mon Apr 24 02:42:09 EST 2006

Hi Damien,

On Apr 23 23:01, Damien Miller wrote:
> In this case, shouldn't cygwin be using socketpair() for interprocess
> communication everywhere? (assuming that there is a select()-like 
> function available in the Win32 API). This switch can be made by 

Yes, actually there is a select function, but it's implemented in the
Windows socket layer, so it's available exclusively for sockets (and
utilized for select on sockets in Cygwin, obviously).

> deleting the following line from "*-*-cygwin*)" block:
> 	AC_DEFINE(USE_PIPES, 1, [Use PIPES instead of a socketpair()])
> To fully use socketpairs, you will need the following patch to scp.c,
> as it doesn't seem to care right now:

Thanks for the patch.  I tried it, but using socketpairs is slower than
using pipes, so, for performance reasons, I'd rather stick with pipes,
now that we have found a nice workaround in Cygwin.

Way back when we started using USE_PIPES for Cygwin, the reason was
actually the performance.  Since the select function has changed over
the time, I assume the now fixed performance problem didn't exist years

As for socketpairs, since Windows has no concept for AF_UNIX/AF_LOCAL
sockets, these sockets are implemented as AF_INET sockets under the
hood.  Using AF_INET sockets locally is 30-40% slower than using pipes
on Windows.


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the openssh-unix-dev mailing list