How do you handle while(1) fork(); ?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Wed Jul 18 17:25:16 AEST 1990


In article <2036 at cirrusl.UUCP> dhesi%cirrusl at 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



More information about the Comp.unix.questions mailing list