home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / internal / 1573 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  1.3 KB

  1. Xref: sparky comp.unix.internals:1573 comp.unix.programmer:3832
  2. Path: sparky!uunet!gatech!mailer.cc.fsu.edu!sun13!delta!mueller
  3. From: mueller@delta.fsu.edu (Frank Mueller)
  4. Newsgroups: comp.unix.internals,comp.unix.programmer
  5. Subject: How to measure context switches time? (Repost)
  6. Message-ID: <9911@sun13.scri.fsu.edu>
  7. Date: 21 Jul 92 19:22:59 GMT
  8. References: <1992Jul16.003742.29920@sbcs.sunysb.edu> <9839@sun13.scri.fsu.edu>
  9. Sender: news@sun13.scri.fsu.edu
  10. Followup-To: comp.unix.internals
  11. Organization: Florida State University Computer Science
  12. Lines: 26
  13.  
  14. Hi there!
  15.  
  16. I'm trying to measure the context switch overhead of UNIX processes (SunOS 4.1).
  17.  
  18. I did something like this:
  19.  
  20. fork off a child,
  21. lower the parent's priority (-> nice lavel)
  22. child installs a signal handler
  23. child suspends on sigpause
  24. parent reads clock (before)
  25. parent sends signal to child
  26. child resumes
  27. child executes signal handler which contains a call to read the clock (after)
  28.  
  29. The approximate time for the context switch is (after-before). But I am also
  30. timing some operations which are not part of the context switch:
  31. (a) the parent's sending of the signal
  32. (b) the overhead of installing a signal handler for the child (_sigtramp etc.)
  33.  
  34. Does anyone know a more accurate way to measure the context switch time
  35. between UNIX processes?
  36.  
  37. Please e-mail: mueller@cs.fsu.edu or post.
  38.  
  39. Frank
  40.