sub parallelizing{
my counter = 0;
my $MAX_PROCESS = 10;
my $workerQueue = Parallel::ForkManager->new($MAX_PROCESS);
$workerQueue->start and next;
print "$process #" . $counter . " started\n";
$counter = $counter +1
$workerQueue->finish;
}
I am using Parallel::ForkManager
to create child processes that share the variable $counter
, but it turns out that it's not shared. Is there any way to let child processes to share a variable?