home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!venezia!penev
- From: penev@venezia (Penio Penev)
- Subject: Re: How Accurate Is The System Clock
- References: <AJ3U.92Dec24203137@larch.cs.virginia.edu>
- Sender: nobody@ctr.columbia.edu
- Organization: Rockefeller University
- Date: Fri, 25 Dec 1992 18:59:31 GMT
- X-Newsreader: TIN [version 1.1 PL6]
- Message-ID: <1992Dec25.185931.28426@sol.ctr.columbia.edu>
- Reply-To: penev@venezia.rockefeller.edu
- X-Posted-From: venezia.rockefeller.edu
- NNTP-Posting-Host: sol.ctr.columbia.edu
- Lines: 52
-
- Asim Jalis (aj3u@larch.cs.virginia.edu) wrote:
- : What I am concerned about is not the accuracy of the clock, so
- : much as the length of the delay between calling the time function
- : and getting a response. This delay could be produced if the
- : scheduler unschedules my process before the clock daemon has
- : responded to its query, or it could be produced if the clock
- : daemon was woken when the clock interrupt occurred because the
- : cpu was doing something else that was important, or for some
- : other reason arising out of the multi-process environment.
- :
- : Testing could be used to get a general idea of how large this
- : delay can be. However, I want to get more confidence about this.
-
- I just tested this with the following FORTH code:
- : TARA FOR 0 DROP NEXT ;
- : CLOCK FOR 0 TIME NEXT ; ok
-
- COUNTER 5000000 CLOCK TIMER 51000 ok
- COUNTER 5000000 TARA TIMER 1000 ok
-
- The numbers are miliseconds, the resolution is 1 second. Timing is the
- overall timing (not user) on an unburdened system. This gives
- ~ 10 microseconds per time(2) call. On my 33MHz R3000 this equivalent
- to ~ 330 instructions. Subtract 10 ( the FORTH overhead). This seems
- a little bit high for a decision making, address check and return of a
- variable, but seems low enough for the designers of the OS to have been
- tempted to multitask.
-
- This of course does not answer Your questions.
-
- : (1) Do the specifications of the operating system provide some
- : kind of a guarantee about timing accuracy in its multi-process
- : environment? (2) Is the code of the operating system public
- : domain? (3) If not, then is the scheduler's design similar enough
- : to Unix so that Unix sources can be studied for an answer to my
- : problem.
-
- Suppose the following situation: The specifications of the operating
- system _does_ provide a guarantee about timing accuracy. That means,
- that Your time variable is accurate a few instructions after the
- system time(2) of itimer(2) calls. This means nothing, because _after_
- the call Your process might be suspended in favor of other processes.
-
- What You really need (IMHO) is a specification of the occasions in
- which control is switched between processes and a semaphore for the
- processor, so You might say smth. like that:
- PROCESSOR GET < do time-accuracy critical job > PROCESSOR RELEASE
-
- As far as my knowledge spreads, this has never been a design goal of
- UNIX.
-
- -- Penio.
-