Jan 30, 2011, 9:57 AM
Post #1 of 3
Is it possible to spawn 3 child processes (other scripts), let them run in parallel, have the parent wait until all are complete, read their output, and then have the parent continue processing?
Spawning Multiple Child Processes
To this group this may seem simple, but I have researched this and am stumped on how to do it.
fork() wants to re-run the parent script and seems only applicable to a single parent and a single child.
exec() doesn't return and complete execution.
system(), and backticks seem to wait until the child exits to continue, which ends up running the 3 child scripts sequentially instead of in parallel.
Any suggestions on how to do this would be GREATLY appreciated.