re:
http://www.perlmonks.org/?node_id=786942
when:
$manager->start and next;
&dowork();
The parent returns true ($pid), and goes to the next iteration of the surrounding loop. The child returns 0, and does the work.
If I understand correctly, if we reach the number of maximum children, the $manager->start will return 0, and the parent will do the work? If so, what’s the best way to stop the parent from doing any work?
Parallel::ForkManager
startwill always start a child. It may have to wait for one of the child to end (when the maximum number of children are running), but it’s fully prepared to do that.It does not return zero except in he child. (It dies on error.)