in reply to Re: Should I call waitpid when using Parallel::ForkManager to fork in an infinite loop?
in thread Should I call waitpid when using Parallel::ForkManager to fork in an infinite loop?
run_on_finish is called in the parent process immediately after reaping the child (to get its exit code). It surprises me that it would be called "much later" since the parent is constantly checking if a child has ended if you use the formula in the documentation.
The only reason it wouldn't be responsive is if you have slow code that executes in the parent. This would delay start getting called, which would delay checking if children have ended. Note that start will actually reap multiple children if more than one have ended.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Should I call waitpid when using Parallel::ForkManager to fork in an infinite loop?
by unlinker (Monk) on Aug 16, 2009 at 18:03 UTC | |
by ikegami (Patriarch) on Aug 16, 2009 at 21:43 UTC |