Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!F.GP.CS.CMU.EDU!rpd
From: rpd@F.GP.CS.CMU.EDU (Richard Draves)
Newsgroups: comp.unix.wizards
Subject: Re: Wait, Select, and a SIGCHLD Race Condition
Message-ID: <496@PT.CS.CMU.EDU>
Date: 11 Dec 87 23:48:33 GMT
References: <5105@sol.ARPA> <4857@cit-vax.Caltech.Edu>
Sender: netnews@PT.CS.CMU.EDU
Organization: Carnegie-Mellon University, CS/RI
Lines: 13

>  on SIGCHLD interrupt, set time_ptr = &ZERO_TIMER;
...
>  numfds = select(...,time_ptr);
...
>| Wen-King Su  wen-king@vlsi.caltech.edu  Caltech Corp of Cosmic Engineers |

This method doesn't quite work.  The problem is if the signal comes in after
the select procedure call but before the trap to the kernel, then the
select will end up blocking because the kernel will get ORIGINAL_TIMER
instead of ZERO_TIMER as the argument to the trap.  The signal handler
must atomically zero out the actual timer structure.

Rich