# And maintain the population. while (1) { sleep; # wait for a signal (i.e., child's + death) for ($i = $children; $i < $PREFORK; $i++) { make_new_child(); # top up the child pool } } #### # And maintain the population. while ((my $pid = waitpid(-1)) > 0) { $children--; delete $children{$pid}; make_new_child() }