[Python-ideas] re-implementing Twisted for fun and profit

Shane Green shane at umbrellacode.com
Sun Oct 14 15:18:29 CEST 2012


Not sure I follow, but yeah: select reports the state of the file-descriptor.  While the descriptor is readable, every call to select will indicate that it's readable, etc. 





Shane Green 
www.umbrellacode.com
805-452-9666 | shane at umbrellacode.com

On Oct 14, 2012, at 5:48 AM, Richard Oudkerk <shibturn at gmail.com> wrote:

> 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
> 
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121014/eeda96c5/attachment.html>


More information about the Python-ideas mailing list