On 10:01 am, greg.ew...@canterbury.ac.nz wrote:
Hrvoje Niksic wrote:
Under Linux, select() may report a socket file descriptor
as "ready for reading", while nevertheless
a subsequent read blocks.
Blarg. Linux is broken, then. This should not happen.
You know what else is broken? MacOS, FreeBSD, Solaris, and every
version of Windows. I haven't tried running Twisted on AmigaOS but I
bet it has some problems too.
On occasion Linux has been so badly broken that Twisted has motivated a
fix. For example,
http://lkml.indiana.edu/hypermail/linux/kernel/0502.3/1160.html
But even if we ignore difficulties at the OS level (which should, after
all, be worked around rather than catered to in API design) there are
other good reasons why the general async API should be fairly distant
from both the select/poll wrapper and the questions of blocking vs. non-
blocking sockets. For another example, consider the issue of non-
blocking SSL sockets. Sometimes, in order to do a "read", you actually
need to do a write and then another read. Which means that application
code, if it wants to be compatible with SSL, needs to deal with any
failure that may come from a write as coming from a read, unless you
abstract all this away somehow.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com