in reply to meddling with forces I can't understand
exec never returns on success, so for(my $ct = 0; $ct <= $#forkArray; $ct+=3) never gets to execute its body more than once.
You never check if fork or exec succeeds.
You never reap your children.
If I'm not mistaken, you run in the parent what you want to run in the child.
The way in which @forkArray is used is not optimally readable.
for (...) { ... push(@forkArray, $level); push(@forkArray, $writeCounter); push(@forkArray, $nextMerge); } for (my $ct = 0; $ct <= $#forkArray; $ct+=3) { my $level = $forkArray[$ct+0]; my $mergeLast = $forkArray[$ct+1]; my $mergeFirst = $forkArray[$ct+2]; ... }
reads better as
for (...) { ... push @forkArray, [ $level, $writeCounter, $nextMerge ]; } foreach (@forkArray) { my ($level, $mergeLast, $mergeFirst) = $@_; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: meddling with forces I can't understand
by downer (Monk) on Oct 25, 2007 at 00:30 UTC | |
by ikegami (Patriarch) on Oct 25, 2007 at 00:36 UTC | |
|
Re^2: meddling with forces I can't understand
by downer (Monk) on Oct 25, 2007 at 00:30 UTC |