Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!cs.umn.edu!uc!shamash!timbuk!paul From: paul@sequoia.cray.com (Paul Dow (CRI-UK)) Newsgroups: comp.unix.questions Subject: Re: How can a child learn of its parents termination? Message-ID: <020715.19092@timbuk.cray.com> Date: 4 Apr 91 09:02:59 GMT Article-I.D.: timbuk.020715.19092 References: <94559@lll-winken.LLNL.GOV> Reply-To: paul@sequoia.cray.com (Paul Dow (CRI-UK)) Organization: Cray Research, Inc. Lines: 21 In article <94559@lll-winken.LLNL.GOV>, booloo@lll-crg.llnl.gov (Mark Boolootian) writes: |> The subject pretty much says it all: Is it possible for a child to receive |> notification of its parent's termination? One possibility would be to check |> the parent process id from time to time but this won't help me. I have a |> child sleeping on a semaphore, normally awakened by the parent. If the parent |> terminates, the child is going to sleep forever. I need some way of waking |> the child up upon parent's death so that the child may exit. |> A couple of ideas might be: 1) Use the SEM_UNDO option for a semaphore - this can be used to adjust the value of a semaphore when a process exits. 2) Use a pipe between the parent & child process. The child could then detect the loss of the pipe. It sounds to me as if option 1) is what will provide what you're looking for. Paul.