Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!sci.ccny.cuny.edu!phri!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.questions Subject: Re: How do you handle while(1) fork(); ? Message-ID: <20784:Jul1807:25:1690@kramden.acf.nyu.edu> Date: 18 Jul 90 07:25:16 GMT References: <1990Jul11.115612.2155@aucs.uucp> <4261@uqcspe.cs.uq.oz.au> <2036@cirrusl.UUCP> Organization: IR Lines: 11 In article <2036@cirrusl.UUCP> dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) writes: > kill (-1, SIGTERM); /* give each process a software termination signal */ > sleep (3); /* and give it 3 seconds to clean up */ If the processes aren't malicious, 3 seconds probably isn't enough--- remember that the system is heavily loaded. If the processes are malicious, sleep() renders your solution useless. At least split the program into two, the first with a sleep(30) and the second with no pause. ---Dan