in reply to Re: Parallel::ForkManager run_on_finish() bug?
in thread Parallel::ForkManager run_on_finish() bug?

wait_one_child is an undocumented method of P:FM, but it seems like that would be useful in your case. An attempt at psueudo-code:
while ($stuff_to_do) { for my $job (@job_list) { $pm->start($job) and next; $pm->finish(); } if ($still_doing_stuff) { # run_on_finish might push more stuff to @job_list $pm->wait_one_child(); } }

Replies are listed 'Best First'.
Re^3: Parallel::ForkManager run_on_finish() bug?
by bsingh (Novice) on Jul 15, 2013 at 07:38 UTC
    How would you use it the example code given by anshumangoyal above?
    I have the same problem on perl 5.18 and P:FM 1.03.
    I have the same code running on production for years on 5.10 and P:FM 0.7.5 without any issues.