No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
But now my parent process dies when i use
exec('touch', $callCount);
die $!;
in child process. Here is the code:
while ($callCount <= $totalCalls) { for (1..$callPerSec) { printf "Call -> $callCount"; my $pid = fork(); if($pid) { #in Parent Process printf " :: PID -> $pid\n"; push(@list_of_pid, $pid); } elsif($pid == 0){ #in Child Process exec ('touch', $callCount); die $!; } else { printf "Resource Not available\n"; } $callCount++; } print "Total Calls Executed $callCount\n"; In reply to Re^2: Fork Results in thousands of processes
by anshumangoyal
|
|