Hi,

I am facing an issue. Below is code snippet : -

my $pm = new Parallel::ForkManager(10);

 my $count=0;

foreach my $user (@users) {

               $pm->start($user) and next;

               my $result;

             --- do some processing ---

               $pm->finish(0, \$result);

}



$pm->wait_all_children;


However the final value of count is not correct. Is there some race
condition on same variable updation by the processes ?

Regards,
Punit



pm -> run_on_finish (

               sub {

                               my $result = @;

                               if (defined($result)) {

                               my $count += $result;

                               }

               }


However I

Reply via email to