Subject: | runqueue does not empty @queue parameter |
The Parallel::Queue 0.04 POD suggests the following usage:
use Parallel::Queue qw( runqueue verbose fork );
runqueue 4, @queue;
die "Incomplete jobs" if @queue;
However this does not work as expected:
perl -e 'use Parallel::Queue qw(runqueue verbose fork); @queue = map {
sub { return 0; } } (1,2,3); runqueue 4, @queue; print "\@queue = ",
scalar @queue, "\n"'
Forking initial 4 proc
Executing: 12081
fork: 12081
Executing: 12082
fork: 12082
Executing: 12083
fork: 12083
Executing: 12084
@queue = 3
fork: 12084
Looping remainder of list...
exit: 12081 (0)
exit: 12082 (0)
exit: 12083 (0)
exit: 12084 (0)
@queue = 3