From: "Christopher Friesen" <cfriesen@nortel.com>
To: Bernd Petrovitsch <bernd@firmix.at>
Cc: Alex Riesen <raa.lkml@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: select(0,NULL,NULL,NULL,&t1) used for delay
Date: Thu, 06 Oct 2005 09:57:02 -0600 [thread overview]
Message-ID: <4345494E.8030007@nortel.com> (raw)
In-Reply-To: <1128613370.6630.5.camel@tara.firmix.at>
Bernd Petrovitsch wrote:
> On Thu, 2005-10-06 at 09:26 -0600, Christopher Friesen wrote:
> And it's cooler to hack the kernel than to create and use a
> portable_sleep() function and use it.
If there is a substantial codebase using select() for sleeping, then it
makes sense to improve the efficiency of the kernel. Fix it in one
place, make all the apps run better.
>>The select() man page explicitly mentions this usage;
>>
>>"Some code calls select with all three sets empty, n zero, and a
>>non-null timeout as a fairly portable way to sleep with subsecond
> ^^^^^^^^^
>>precision."
> ^^^^^^^^^
>
> You do realize that "subsecond precision" is probably meant as
> improvement to sleep(3) and surely not to nanosleep(2)?
select() allows for the selection of sleep time with microsecond
precision. The mainline kernel can't sleep for that small an interval
anyway, so there's not really any difference in sleep precision between
the two.
As I mentioned earlier, select() actually sleeps more accurately than
nanosleep() on many kernels. I haven't tested the most recent to see if
this is still true though.
Chris
next prev parent reply other threads:[~2005-10-06 15:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-06 13:49 select(0,NULL,NULL,NULL,&t1) used for delay Madhu K.S.
2005-10-06 14:25 ` Jesper Juhl
2005-10-06 14:28 ` Jesper Juhl
2005-10-06 19:05 ` Howard Chu
2005-10-06 19:41 ` Christopher Friesen
2005-10-06 14:27 ` Alex Riesen
2005-10-06 15:26 ` Christopher Friesen
2005-10-06 15:42 ` Bernd Petrovitsch
2005-10-06 15:57 ` Christopher Friesen [this message]
2005-10-06 17:30 ` Bob Copeland
2005-10-10 18:06 ` Bill Davidsen
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=4345494E.8030007@nortel.com \
--to=cfriesen@nortel.com \
--cc=bernd@firmix.at \
--cc=linux-kernel@vger.kernel.org \
--cc=raa.lkml@gmail.com \
/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