sub-second sleeps on BSD 4.2

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Thu Apr 25 04:27:16 AEST 1985


> void nullfunc(){
>     wakeup = 1;
> }
> ...
>     signal(SIGALRM, nullfunc);
Sometimes the signal will fire HERE, ...
>     wakeup = 0;
>     if(setitimer(ITIMER_REAL, &tm, NULL)) exit(1);
>     while(wakeup == 0) sigpause(0);
... so you won't see it here.

The simplest way to get sub-second naps on 4.2BSD is to
do a select() specifying no file descriptors and a small timeout.



More information about the Comp.unix.wizards mailing list