Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!hsdndev!cmcl2!adm!news From: lhummel@urbana.mcd.mot.com (Lionel Hummel) Newsgroups: comp.unix.wizards Subject: UNIX-WIZARDS Digest V12#132 Message-ID: <27219@adm.brl.mil> Date: 17 Jun 91 16:03:00 GMT Sender: news@adm.brl.mil Lines: 25 > program 1 sends a SIGUSR1 signal to program 2, then waits to > receive a SIGUSR1 signal from program 2. It repeats this 100 > times. > program 2 just catches SIGUSR1 signals from program 1 and sends > a SIGUSR1 signal back. > What surprises me is that it takes 70 seconds to send the 100 > signals back and forth! > Is it possible to get better timing on this? I guess what I'd > like to do is to force a context switch when I send the signal > and get much better "turn" around. The sigpause() call, which is documented on the sigset(2) man page, will do what you want. Using your example but including a sigpause(SIGUSR1), I find that a pair of processes bouncing a SIGUSR1 back and forth 100 times executes in less than a second. < Lionel ----------- Lionel D. Hummel, Software Engineer [H] (217) 344-8713 Motorola Computer Group, Urbana Design Center [W] (217) 384-8511 lhummel@urbana.mcd.mot.com uiucuxc!udc!lhummel uiucdcs!large!lionel