in reply to IPC::Shareable and Parallel::Forkmanager Question
I can't test my theory ( no IPC::Shareable on this machine ), but possibly the problem is that although you shlock your variable for the increment, you don't for when you test and restart it... what happens when you change you code to this? :
for(my $i = 0; $i < 100; $i++) { $pm->start and next; (tied $testvr)->shlock; if($testvr >= 5) { $testvr = 0; } $testvr++; print $testvr . "\n"; tied $testvr)->shunlock; $pm->finish; } $pm->wait_all_children;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IPC::Shareable and Parallel::Forkmanager Question
by anlamarama (Acolyte) on Nov 03, 2009 at 21:21 UTC |