anshumangoyal has asked for the wisdom of the Perl Monks concerning the following question:
I am having an issue with Fork in Perl. I want to execute 10 Fork Processes at a go from one single script and all 10 Child (Forked) processes will do the same thing (Copy files from one place to another).
Now when I execute this code, there are around 1000 child processed which are executed. Can any one tell me what wrong I am doing here.while ($callCount <= $totalCalls) { for (1..$TotalProcessToFork) { print "Call -> $callCount"; if($pid = fork) { #in Parent Process print " :: PID -> $pid\n"; push(@list_of_pid, $pid); } else { #in Child Process `touch $callCount`; } $callCount++; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fork Results in thousands of processes
by ikegami (Patriarch) on Nov 28, 2011 at 10:59 UTC | |
Re: Fork Results in thousands of processes
by ikegami (Patriarch) on Nov 28, 2011 at 11:00 UTC | |
| |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom