[Python-Dev] Draft PEP to make file objects support non-blocking mode.

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 22 01:55:55 CET 2005


Donovan Baarda wrote:
> On Mon, 2005-03-21 at 17:32 +1200, Greg Ewing wrote:
>>
>>I don't agree with that. There's no need to use non-blocking
>>I/O when using select(), and in fact things are less confusing
>>if you don't.
> 
> Because staller.py outputs and flushes a fragment of data smaller than
> selector.py uses for its reads, the select statement is triggered, but
> the corresponding read blocks.

Your selector.py is using file object read/write methods,
not os.read and os.write.

I fully agree that you can't reliably use stdio-style I/O in
conjunction with select(). But as long as you use os-level
I/O, there shouldn't be any need to make anything non-blocking.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list