Amphiaraus has asked for the wisdom of the Perl Monks concerning the following question:
My problem is, I have several functions in my Perl script that used forked processes, and I need to use Proc::Queue in each of these functions to cap the maximum number of active forked processes allowed.use Proc::Queue size => 5, debug => 1; use POSIX ":sys_wait_h"; # imports WNOHANG foreach (1..20) { my $f=fork; (my child processes do stuff) exit 0; # stop a child process 1 while waitpid(-1, WNOHANG)>0; # reaps children }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Proc::Queue problem
by salva (Canon) on Oct 23, 2008 at 08:57 UTC | |
by afresh1 (Hermit) on Oct 24, 2008 at 01:57 UTC | |
|
Re: Proc::Queue problem
by afresh1 (Hermit) on Oct 23, 2008 at 03:37 UTC |