[ntp:questions] Re: program to test actual resolution of Linux?
mayer at gis.net
Thu Sep 11 21:50:07 UTC 2003
Ulrich Windl <Ulrich.Windl at RZ.Uni-Regensburg.DE> wrote in message news:<m33cf4vgmn.fsf at pc5234.klinik.uni-regensburg.de>...
> "David L. Mills" <mills at udel.edu> writes:
> for practical use: Does it make any difference? The only way to
> observe the system clock is by making system calls. If you see just
> nanoseconds or multiples of it, you may assume the clock has no better
> resolution. Did I think wrong?
> > While the procedure reads the clock several times, it is a bit more
> > tricky than first apparent. Some kernels (nanokernel/microkernel at
> > least from here) require Lamport's happens-before relation be rigorously
> > defended, so if the clock counter is really gross, like old Sun 500
> > microseconds, and the clock is read several times during that clock
> > tick, the time advances by une unit (nano or micro) for each read.
> For my hardware this has never been a problem, because you cannot
> execute two system calls within the same nanosecond. Even for a
> microsecond you need a really fast machine. Still, the
> time-compression is only temporary, right? I mean the amount is
> returned to the user but the system clock doesn't get that amount
> > Unless detected and avoided, this could mislead the results. Time is so
> > fickle and intricate.
> > Dave
It's worse than that. The topic subject has no real meaning. You cannot
measure ACTUAL resolution. You can only estimate it with some error range.
Moreover the act of measuring interferes with what is being measured.
See Heisenberg's Uncertainty Principle for details. Things like standard
deviation are important here. Standard CPU clocks can also fluctuate in
their 'tick'. CPU manufacturers have to test that before they ship the
chip. That doesn't mean that they won't ship chips that wildly vary. There
was a recent discussion of this issue. Jeff Mogul, who has more information
that I do had responded to that discussion.
More information about the questions