lkml.org 
[lkml]   [2011]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Does Linux select() violate POSIX?
On 06/18/2011 11:06 AM, Nemo Publius wrote:
> Suppose I have a file descriptor referencing a TCP/IP socket in blocking mode.
>
> Suppose select() reports that the descriptor is ready for reading.
>
> If I then call recv() on that descriptor, can it _ever_ block?

There was a long discussion about this back in 2004.

http://lkml.org/lkml/2004/10/6/117

Based on that discussion and the need to deal with legacy apps,
udp_poll() has special-case code to handle blocking sockets--it
validates the checksum before declaring the socket readable. This costs
some performance, so for non-blocking sockets the checksum validation is
deferred until later when it will be hot in the cache due to the copy to
userspace.

Other protocols may not handle this and so the warning is still valid in
general.

Chris


--
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com


\
 
 \ /
  Last update: 2011-06-22 20:29    [W:0.054 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site