home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.internals:1573 comp.unix.programmer:3832
- Path: sparky!uunet!gatech!mailer.cc.fsu.edu!sun13!delta!mueller
- From: mueller@delta.fsu.edu (Frank Mueller)
- Newsgroups: comp.unix.internals,comp.unix.programmer
- Subject: How to measure context switches time? (Repost)
- Message-ID: <9911@sun13.scri.fsu.edu>
- Date: 21 Jul 92 19:22:59 GMT
- References: <1992Jul16.003742.29920@sbcs.sunysb.edu> <9839@sun13.scri.fsu.edu>
- Sender: news@sun13.scri.fsu.edu
- Followup-To: comp.unix.internals
- Organization: Florida State University Computer Science
- Lines: 26
-
- Hi there!
-
- I'm trying to measure the context switch overhead of UNIX processes (SunOS 4.1).
-
- I did something like this:
-
- fork off a child,
- lower the parent's priority (-> nice lavel)
- child installs a signal handler
- child suspends on sigpause
- parent reads clock (before)
- parent sends signal to child
- child resumes
- child executes signal handler which contains a call to read the clock (after)
-
- The approximate time for the context switch is (after-before). But I am also
- timing some operations which are not part of the context switch:
- (a) the parent's sending of the signal
- (b) the overhead of installing a signal handler for the child (_sigtramp etc.)
-
- Does anyone know a more accurate way to measure the context switch time
- between UNIX processes?
-
- Please e-mail: mueller@cs.fsu.edu or post.
-
- Frank
-