in reply to Re^6: Graceful shutdowns and Parallel::ForkManager
in thread Graceful shutdowns and Parallel::ForkManager

Ah! Now I see where the confusion comes from.

$pm->start() is a BLOCKING operation.

It waits until a process slot becomes available then forks and returns.

The "parent" process gets a return value of 0, so it does next, and goes back to $pm->start.

When your alarm fires, your eval is interrupted, so no more start calls will be made. So you don't have to worry about more tasks being dispatched, and your running tasks will complete normally since you wait for them.
--
Mike

  • Comment on Re: Re^6: Graceful shutdowns and Parallel::ForkManager