All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Short sleep precision
Date: Sun, 20 Mar 2005 05:04:03 -0800	[thread overview]
Message-ID: <20050320050403.672bf30a.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0503201316320.18044@yvahk01.tjqt.qr>

Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
>
> I have found that FreeBSD has a very good precision of small sleeps --

Linux nanosleep() used to have a busywait loop for sleeps less than two
milliseconds.  2.4.x still does.

We thought it was stupid and took it out.

>  what's holding Linux back from doing the same? Using the code snippet below, 
>  FBSD yields between 2 and 80 us on the average while Linux is at 
>  "constantly" ~100 (with HZ=1000) and ~1000 (HZ=100).
> 

You can spin on the gettimeofday() result in userspace.

      parent reply	other threads:[~2005-03-20 13:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-20 12:25 Short sleep precision Jan Engelhardt
2005-03-20 12:44 ` Jesper Juhl
2005-03-20 13:34   ` Jan Engelhardt
2005-03-21 16:35     ` Chris Friesen
2005-03-22  2:46       ` Robert White
2005-03-22  7:46       ` Jan Engelhardt
     [not found]         ` <424036AE.1040404@nortel.com>
2005-03-22 15:19           ` Jan Engelhardt
2005-03-20 13:04 ` Andrew Morton [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=20050320050403.672bf30a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.