All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: frankeh@watson.ibm.com
Cc: matthew@hairy.beasts.org, linux-kernel@vger.kernel.org,
	lse-tech@lists.sourceforge.net
Subject: Re: futex and timeouts
Date: Thu, 14 Mar 2002 15:15:52 +1100	[thread overview]
Message-ID: <E16lMef-00022r-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Wed, 13 Mar 2002 13:26:53 CDT." <20020313182552.945523FE06@smtp.linux.ibm.com>

In message <20020313182552.945523FE06@smtp.linux.ibm.com> you write:
> 
> Ulrich, it seems to me that absolute timeouts are the easiest to do.
> 
> (a) expand by additional parameter (0) means no timeout desired
> (b) differentiate the schedule call in futex_down..
> 
> Question is whether the granularity of jiffies (10ms) is sufficiently small 
> for timeouts.....

1) You must not export jiffies to userspace.

2) They are not a time, they are a counter, and they do wrap.

3) This does not handle the settimeofday case: you need to check in
   userspace for that anyway.

So, since you need to check if you're trying to sleep for longer than
(say) 49 days, AND you need to check if you are after the given
abstime in userspace anyway (settimeofday backwards), you might as
well convert to relative in userspace.

Sorry,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  parent reply	other threads:[~2002-03-14  4:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-13 18:26 futex and timeouts Hubertus Franke
2002-03-13 18:54 ` Ulrich Drepper
2002-03-14  4:15 ` Rusty Russell [this message]
2002-03-14 15:19   ` Hubertus Franke
2002-03-15  5:39     ` [PATCH] " Rusty Russell
2002-03-15  6:08       ` Joel Becker
2002-03-15  6:56         ` H. Peter Anvin
2002-03-15  8:49         ` Rusty Russell
2002-03-15 15:16         ` Hubertus Franke
2002-03-15 16:04           ` Joel Becker
2002-03-15 18:59             ` Hubertus Franke
2002-03-15 19:28               ` Joel Becker
2002-03-16  1:12                 ` [Lse-tech] " george anzinger
2002-03-18 21:35                   ` Hubertus Franke

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=E16lMef-00022r-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=frankeh@watson.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=matthew@hairy.beasts.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.