monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] hang on Win32/MinGW with sync file:


From: Zack Weinberg
Subject: Re: [Monotone-devel] hang on Win32/MinGW with sync file:
Date: Tue, 4 Dec 2007 16:44:25 -0800

On Dec 4, 2007 4:33 PM, Stephen Leake <address@hidden> wrote:
> >> Note that dumb_socketpair is _not_ actually cross-platform; it has the
> >> same #ifdef WIN32 style that netxx_pipe.cc currently has, and the WIN32
> >> version has an extra parameter that is important. Apparently 'socketpair'
> >> is implemented on some/most "unix" platforms, but not on Win32?
> >
> > Right, that code is an implementation of socketpair() for Windows because it
> > is not provided by the Windows socket API.  Cross platform refers to the
> > rest of the code--all platforms can use socketpair() and almost all of the
> > rest of the code can be shared between platforms (except for process
> > creation, but we probably already have sufficient wrappers for these in the
> > $platform/ directories already).
>
> Currently, all code outside netxx_pipe.cc uses netxx_pipe.cc. So I
> don't see what we are gaining by replacing Unix pipes by TCP sockets.

Unless I am very confused, the idea is to be able to use the current
Unix-specific code (replacing two calls to pipe() with one call to
socketpair()) on both Unix and Windows; and the benefit of this is
that the low-level Windows API for asynchronous I/O has fundamentally
different semantics from the low-level Unix API, and the rest of netxx
expects the Unix semantics, which is why we are getting hangs.

... wait, are we actually going to be able to do async I/O with ncm's
fake socketpair()?  I do not fully understand the significance of the
"make_overlapped" flag, but I see comments in netxx_pipe.cc averring
that async I/O only works on Windows in overlapped mode, and comments
in socketpair.c saying the socket is not suitable for use as a child
process stdio handle if overlapped mode is on.

zw




reply via email to

[Prev in Thread] Current Thread [Next in Thread]