[Python-3000] Non-blocking I/O? (Draft PEP for New IO system)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 5 01:19:49 CET 2007


I'm having trouble seeing what the use case is for
the buffered non-blocking writes being discussed here.

Doing asynchronous I/O usually *doesn't* involve
putting the file descriptor into non-blocking mode.
Instead you use select() or equivalent, and only
try to read or write when the file is reported as
being ready.

For this to work properly, the select() needs to
operate at the *bottom* of the I/O stack. Any
buffering layers sit above that, with requests for
data propagating up the stack as the file becomes
ready.

In other words, the whole thing has to have the
control flow inverted and work in "pull" mode
rather than "push" mode. It's hard to see how this
could fit into the model as a minor variation on
how writes are done.

--
Greg


More information about the Python-3000 mailing list