From: Chris Friesen <chris.friesen@genband.com>
To: Nemo Publius <nemo@self-evident.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Does Linux select() violate POSIX?
Date: Wed, 22 Jun 2011 12:20:58 -0600 [thread overview]
Message-ID: <4E02328A.80305@genband.com> (raw)
In-Reply-To: <BANLkTik9HzR_oJ7FocQ=o+zNoK22tUTjBg@mail.gmail.com>
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
prev parent reply other threads:[~2011-06-22 18:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-18 17:06 Does Linux select() violate POSIX? Nemo Publius
2011-06-18 17:43 ` Eric Dumazet
2011-06-18 18:22 ` Nemo Publius
2011-06-18 18:33 ` Alan Cox
2011-06-18 18:51 ` Nemo Publius
2011-06-19 14:41 ` Bernd Petrovitsch
2011-06-19 22:21 ` Nemo Publius
2011-06-19 22:32 ` Alan Cox
2011-06-19 22:45 ` Nemo Publius
2011-06-22 18:20 ` Chris Friesen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E02328A.80305@genband.com \
--to=chris.friesen@genband.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nemo@self-evident.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox