From: Bernd Petrovitsch <bernd@firmix.at>
To: Christopher Friesen <cfriesen@nortel.com>
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 17:42:50 +0200 [thread overview]
Message-ID: <1128613370.6630.5.camel@tara.firmix.at> (raw)
In-Reply-To: <43454238.4040907@nortel.com>
On Thu, 2005-10-06 at 09:26 -0600, Christopher Friesen wrote:
> Alex Riesen wrote:
>
> > Why don't you just use nanosleep(2) (or usleep)?
>
> I can think of one main reason...existing code. Also, nanosleep()
And it's cooler to hack the kernel than to create and use a
portable_sleep() function and use it.
> rounds up excessively in many kernel versions, so that a request to
> sleep for less than 1 tick ends up sleeping for 2 ticks.
^^^^^^^
> 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)?
Bernd
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services
next prev parent reply other threads:[~2005-10-06 15:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-06 13:49 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 [this message]
2005-10-06 15:57 ` Christopher Friesen
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=1128613370.6630.5.camel@tara.firmix.at \
--to=bernd@firmix.at \
--cc=cfriesen@nortel.com \
--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
all inboxes | Powered by JetHome®