in reply to Re^2: missing values when using Parallel::ForkManager
in thread missing values when using Parallel::ForkManager
I expected each row should generate ten numbers from 2 to 11. However, several rows will miss values. Even worse, several rows output 11 numbers instead of 10 numbers, and have replicate, for example, 10 appear twice. Why?#!/usr/bin/perl use strict; use Parallel::ForkManager; my $pm = Parallel::ForkManager->new(10); foreach my $j (1..100) { LINKS: for my $i (1..10) { $pm->start and next LINKS; my $num = count($i); print $num,"\t"; $pm->finish; } print "\n"; $pm->wait_all_children; } sub count { my $num = shift; return $num + 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: missing values when using Parallel::ForkManager (order)
by tye (Sage) on Jul 07, 2015 at 04:07 UTC | |
|
Re^4: missing values when using Parallel::ForkManager
by Anonymous Monk on Jul 07, 2015 at 02:46 UTC | |
by Anonymous Monk on Jul 08, 2015 at 08:27 UTC |