[issue12328] multiprocessing's overlapped PipeConnection on Windows

sbt report at bugs.python.org
Wed Feb 1 15:50:32 CET 2012


sbt <shibturn at gmail.com> added the comment:

I have done an updated patch.  (It does *not* switch to using bytes oriented pipes as I suggested in the previous message.)

The patch also adds a wait() function with signature

    wait(object_list, timeout=None)

for polling multiple objects at once.  On Unix it is just a wrapper for

    select.select(object_list, [], [], timeout)

except that it retries when it gets EINTR.  wait() works with "connected" sockets too, although on Windows it does not work for "listening" sockets.

The patch removes SentinelReady and changes concurrent.futures to use wait() instead.

Polling is now done by issuing zero length overlapped reads.  This means that the pipe is not modified except possibly if a zero length message is removed.

I changed ReadFile(), WriteFile() and GetOverlappedResult() to return pairs, the second entry of which is zero or an "expected" error code.  (Unexpected errors still raise an exception.)  This avoids the need to ever use GetLastError().

----------
Added file: http://bugs.python.org/file24388/pipe_poll_fix.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12328>
_______________________________________


More information about the Python-bugs-list mailing list