From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190610130143q6772b9fdm5ab28ca9f5a3c071@mail.gmail.com> Date: Fri, 13 Oct 2006 18:43:13 +1000 From: "Bruce Ellis" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] waitfor() call question? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Topicbox-Message-UUID: c982d8e2-ead1-11e9-9d60-3106f5b1d025 the culprit, not the scene of the crime. brucee On 10/13/06, Russ Cox wrote: > > Nemo's book (http://lsub.org/who/nemo/9.intro.pdf, page 91) gives code > > for waiting for a particular descendant process if that's what's > > wanted. Actually, he uses it for the immediate child process, which > > makes me wonder=97after the child process has exited, can the parent > > wait() for a grandchild? > > Nope. > > > Why is waitfor() "occasionally unavoidable" on UNIX? > > Because sometimes what would be multiple processes on Plan 9 > is a single process on Unix, depending on the implementation of > the thread library, and two shared-memory procs each waiting for > their own children need not to get the other's child. > You could have some shared list of accidentally-waited-for children > but then the coordination to wake up the guy who is actually > waiting gets cumbersome. > > Russ >