>  Under Linux, select() may report a socket file descriptor as "ready
>  for reading", while nevertheless a subsequent read blocks. This could
>  for example happen when data has arrived but upon examination has
wrong
>  checksum and is discarded. There may be other circumstances in which
a
>  file descriptor is spuriously reported as ready. Thus it may be safer
>  to use O_NONBLOCK on sockets that should not block.

OK, they now have my permission to remove select/poll too, and
provide only one GOOD way to do AIO.  :-)  I guess I'd let them
have nbread/nbwrite too, but only grudgingly, as I hate polling
just on principle.

Honestly, that Oh-never-mind-the-checksum-was-bad sounds like a
CYA hack to excuse a poorly-thought-out optimization where they
scheduled early.  The other is CYA for SMP races.

Whether YOU are willing to wait or not has nothing to do
with the source/sink of the data.  The O_NONBLOCK bit shouldn't
be part of the in-kernel shared FD structure, but rather only
one process's view of said FD, affecting only that one process's
API to the FD.  O_NONBLOCK could be inherited via fork, but never
propagated back to the parent.

--Jim




_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to