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

Is this on Windows? There shouldn't be any $SIG{CHLD} handler necessary, as P::FM uses waitpid to determine when a process ends and whether to call run_on_finish(). I'm not sure if that would work on Windows.

Or is there some other code calling wait() or waitpid()?

Are you calling wait_all_children() after you're done?

Replies are listed 'Best First'.
Re^2: Parallel::ForkManager run_on_finish() bug?
by bot403 (Beadle) on May 03, 2012 at 21:33 UTC

    This is on AIX. I do call wait_all_children() at the end but due to the way I'm performing work and receiving new work I'm neither waiting on $pm->start nor wait_all_children() so waitpid() in P:FM isn't called. I don't have new work for my classic for() loop until children finish and run_on_finish() is called. Basically run_on_finish() is my only way to get new work.

    My code does not call wait() or waitpid(). I don't think I can post my code but let me see if I can get a reproducible small test case.