[Python-ideas] re-implementing Twisted for fun and profit
Richard Oudkerk
shibturn at gmail.com
Sun Oct 14 14:48:30 CEST 2012
On 14/10/2012 6:29am, Greg Ewing wrote:
> Not sure if this is relevant, but I'd just like to point out
> that the behaviour of select() in this respect is actually
> *edge triggered* by this definition. Once it has reported that
> a given file descriptor is ready, it *won't* report that file
> descriptor again until you do something with it. This can be
> a subtle source of bugs in select-based code if you're not
> aware of it.
Unless I have misunderstood you, the following example contradicts that:
>>> import os, select
>>> r, w = os.pipe()
>>> os.write(w, b"hello")
5
>>> select.select([r], [], [])
([3], [], [])
>>> select.select([r], [], [])
([3], [], [])
--
Richard
More information about the Python-ideas
mailing list