home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!mcsun!Germany.EU.net!murignis!ap542!D012S436!frank
- From: frank@D012S436.sniap.mchp.sni.de ()
- Subject: Re: Alarm() and children
- Message-ID: <1992Aug21.101444.1149@sniap.mchp.sni.de>
- Sender: news@sniap.mchp.sni.de (News Admin)
- Organization: Siemens-Nixdorf AG
- References: <1992Aug14.055543.26826@nuscc.nus.sg>
- Date: Fri, 21 Aug 92 10:14:44 GMT
- Lines: 23
-
- ccechk@nuscc.nus.sg (Heng Kek) writes:
- : If I have a program which spawns 20 children almost simultaneously
- : (i.e. via a loop) and arrange for a SIGALRM to be delivered after
- : 'x' seconds in each of the children, will the signal in one child
- : affect other children?
- :
- : The alarm() is called in each of the children.
- :
-
- No, each process has an independent alarm. I think you also need
- to set up the signal handler *after* the fork.
-
- Btw, Watch out for the library call 'sleep', it uses alarm().
- It will cancel any outstanding alarm - I spent several hours
- looking for that one the first time I came across it!
-
-
- Hope this helps,
- --
- Frank O'Dwyer Disclaimer:
- Siemens-Nixdorf AG I will deny everything
- Tel. : +49 (89) 636-40639 Fax. : +49 (89) 636-45860
- e-mail: Frank.ODwyer@sniap.mchp.sni.de
-