[Python-ideas] The async API of the future

Richard Oudkerk shibturn at gmail.com
Wed Jan 16 19:54:50 CET 2013


On 16/01/2013 5:59pm, Paul Moore wrote:
 > I've just been looking at this, and from what I can see, am I right in
 > thinking that the IOCP support is*only*  for sockets? (I'm not very
 > familiar with socket programming, so I had a bit of difficulty
 > following the code). In particular, it can't be used to register
 > non-socket file objects? From my understanding of the IOCP
 > documentation on MSDN, this is fundamental - IOCP can only be used on
 > HANDLE objects that have been opened with the FILE_FLAG_OVERLAPPED
 > flag, which is not used by "normal" Python IO objects like file
 > handles and pipes, so it will never be possible to poll these objects
 > using IOCP.

Only sockets are supported because it uses WSARecv()/WSASend(), but it 
could very easily be made to use ReadFile()/WriteFile().  Then it would 
work with overlapped pipes (as currently used by multiprocessing) or 
other files openned with FILE_FLAG_OVERLAPPED.

IOCP cannot be used with normal python file objects.  But see

     http://bugs.python.org/issue12939

-- 
Richard




More information about the Python-ideas mailing list