[Python-ideas] The async API of the future
itamar at futurefoundries.com
Sat Nov 3 13:02:09 CET 2012
On Fri, Nov 2, 2012 at 5:29 PM, Sturla Molden <sturla at molden.no> wrote:
> Thus, I think it is possible to get high performance without IOCP. But
> Microsoft has only implemented a select call for sockets. My suggestion
> would be to forget about IOCP and implement select for more than just
> sockets on Windows. The reason for this is that select and IOCP are
> signalling on different side of the I/O operation (ready vs. completed). So
> programs based on select ans IOCP tend to have opposite logics with respect
> to scheduling I/O. And as the general trend today is to develop for Unix
> and then port to Windows (as most programmers find the Windows API
> annoying), I think it would be better to port select (and perhaps poll and
> epoll) to Windows than provide IOCP to Python.
Twisted supports both select()-style loops and IOCP, in a way that is
transparent to user code. They key is presenting an async API to users
(e.g. Protocol.dataReceived gets called with bytes), rather than e.g.
trying to pretend they're talking to a socket-like object you can call
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas