CPU clock handling

Ulrich Drepper drepper@redhat.com
Sat Apr 21 01:03:00 GMT 2001


I've just checked in a bunch of fixes for the x86 CPU clock handling.
The standard is a bit weak since it does not explain in the places
where you would expect what the requirements for the clocks are.  I've
read a bit more in the standard and came to the conclusion that the
semantics is as follows:

- the CPU clock for the process starts as zero when the process starts
  (well, at least to some degree, the 100% correct start time cannot be
  determined).  What happened so far is the time from the startup of the
  system was returned

- the thread CPU clocks are handled similarly, namely, they start at
  thread creation time.  So far they were handled exactly like the
  process CPU clock.

This interpretation makes much more sense and is more useful.  It also
allows a trivial implementation of clock_settime for these clocks.

In case somebody wants to implement CPU clocks for another
architecture please look at the x86 code.  There are also some changes
to the thread library necessary.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------



More information about the Libc-hacker mailing list