home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / 18337 < prev    next >
Encoding:
Text File  |  1992-12-25  |  2.9 KB  |  68 lines

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