Re: UDP recvmsg blocks after select(), 2.6 bug?

From: Chris Friesen
Date: Thu Oct 07 2004 - 13:15:03 EST


Jean-Sebastien Trottier wrote:
Just an outsider's view of someone that has been following this thread:

Could select() have 2 different behaviors depending on wether the
O_NONBLOCK flag is set or not on the socket.

1. If O_NONBLOCK is set, it can immediately return that the socket is
ready to be read

2. In the case where O_NONBLOCK is not set, select() could wait for all
the checks to be done before deciding to return or not. In this case the
meaning would be "there is data ready", NOT "there *might* be data
ready".

This actually sounds quite interesting.

For applications that are prepared to handle the nonblocking case, you get full speed. For applications coded to POSIX, you get correctness.

It does mean that select() is now a bit more complicated, but applications become much easier to write.

Chris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/