lkml.org 
[lkml]   [2000]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sysconf (was Re: RLIM_INFINITY inconsistency between archs)
Andi Kleen wrote:
> H. Peter Anvin wrote:
> > I don't think we want to do this! IMO, HZ should not get exported to
> > user space *AT ALL*. Instead, for the few interfaces that need it,
> > we'll export a "user space HZ" (USER_HZ) which is fixed. No need for
> > a kernel hack. When we support nonstandard values for HZ, we need to
> > fix the few interfaces that actually export jiffies values to convert
> > from "user jiffies" to real jiffies.
>
> I think the point is less HZ as unit (it shouldn't be a user visible one),
> but some programs want to know the timer tick to adapt themselves to it; e.g.
> to calibrate their timers. Of course it is only an approximation because
> timer events can always be late in a multitasking environment, but it
> usually should work out.

Indeed, such as:

1. select() up until desired time minus 1 tick.
2. busy wait using gettimeofday().

I had to do that to get a simple X snake game to appear smooth on
Solaris. Though I never did ask Solaris for the HZ value, I just used a
value that seemed to work well. In this case a self-calibrating method
would probably be ok -- if you're missing deadlines regularly, increase
estimate of tick time.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2011 Jasper Spaans