Sleep vs. alarm/pause

utzoo!decvax!ucbvax!unix-wizards utzoo!decvax!ucbvax!unix-wizards
Thu Nov 12 22:13:19 AEST 1981


>From cbosg!dale at Berkeley Thu Nov 12 21:35:35 1981
The problem described re. sleep using alarm/pause is real and is slightly
worse than that described. In the standard system a user process using
both alarms and sleeps can truely get messed up. This can be fixed by
appropriate changes in the library interface routines. But the race
of the alarm going off before the pause can be done is still there.
We have fixed this in some systems by making pause return immediately
if there is no alarm pending. This has the unfortunate side effect of
not being able to use pause to wait for another signal unless an
alarm is set first. But it seems that this is better in most applications
than having a pause that may never return. The best bet may, as has already
been suggested, be to use the Berkeley signal stuff.



More information about the Comp.unix.wizards mailing list