07-16-07 12:20 PM
On Jul 13, 11:20 am, William Pursell <bill.purs...@gmail.com> wrote:
> By default, pretty much all I/O is blocking. If you want to
> get non-blocking I/O, you have to set your file descriptor
> non-blocking. If you do nothing and just use fread/fwrite,
> they will block until completed. If you use read/write,
> your writes will block, but your reads will return a short
> count if no data is available.
Your reads will return a short count if less data is available than
you asked for. They will block if no data is available, unless it is
clear that no data could ever become available.
The exception is reading from normal files. They will sort of block
and sort of not block. For example if you try to read past the end of
a local file, it will not block in case new data is appended. If you
try to read before the end of a remote file, it will block until all
the requested data is received.
DS
[ Post a follow-up to this message ]
|