in reply to Fork and wait question
You wait in the child instead of in the parent. You might want to look at something like Parallel::ForkManager to handle this kind of thing for you. Otherwise, the easiest thing to do is wait 16 times outside the loop to collect all the children.
You might also want to keep track of all the child PIDs so you can tell which you've reaped and which are still hanging around. If something is taking too long, it might be helpful to be able to kill it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Fork and wait question
by pc88mxer (Vicar) on Jun 12, 2008 at 16:24 UTC | |
by chris68805 (Initiate) on Jun 12, 2008 at 16:51 UTC |