Ronald Oussoren wrote:

> I'm slighly worried about this thread. Async I/O and "read exactly N  
> bytes" don't really match up. I don't know about the other  mechanisms, 
> but at least with select and poll when the system says  you can read 
> from a file descriptor you're only guaranteed that one  call to 
> read(2)/recv(2)/... won't block. The implementation of a  python read 
> method that returns exactly the number of bytes that you  requested will 
> have to call the read system call in a loop and hence  might block.

This is one case where the callback model of async i/o may
help. If there were a way to say "don't call me until you've
got n bytes ready", the descriptor could become ready
multiple times and multiple reads performed behind the
scenes, then when enough bytes are there, your callback
is called.

--
Greg


_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to