Re: futex and timeouts

Rusty Russell (rusty@rustcorp.com.au)
Thu, 14 Mar 2002 15:15:52 +1100


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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/