[Python-ideas] yield from multiple iterables (was Re: The async API of the future: yield-from)
Tom Hoover
thoover at alum.mit.edu
Tue Oct 23 01:36:35 CEST 2012
On Mon, Oct 22, 2012 at 4:09 PM, Guido van Rossum <guido at python.org> wrote:
>
> On Mon, Oct 22, 2012 at 4:04 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> > Guido van Rossum wrote:
> >
> >> The reason we can't ignore IOCP is that it is apparently the *only*
> >> way to do async I/O in a scalable way. The only other polling
> >> primitive available is select() which does not scale.
> >
> >
> > There seems to be an alternative to polling, though. There are
> > functions called ReadFileEx and WriteFileEx that allow you to
> > pass in a routine to be called when the operation completes:
> >
> > http://msdn.microsoft.com/en-us/library/windows/desktop/aa365468%28v=vs.85%29.aspx
> > http://msdn.microsoft.com/en-us/library/windows/desktop/aa365748%28v=vs.85%29.aspx
> >
> > Is there some reason that this doesn't scale either?
>
> I don't know, we've reached territory I don't know at all. Are there
> also similar calls for Accept() and Connect() on sockets? Those seem
> the other major blocking primitives that are frequently used.
>
> FWIW, here is where I read about IOCP being the only scalable way on
> Windows: http://google-opensource.blogspot.com/2010/01/libevent-20x-like-libevent-14x-only.html
It's been years since I've looked at this stuff, but I believe that
you want to use AcceptEx and ConnectEx in conjunction with IOCP.
event_iocp.c and listener.c in libevent 2.0.x could help shed some
light on the details.
More information about the Python-ideas
mailing list