CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Spawning Multiple Child Processes

 



kda406
New User

Jan 30, 2011, 9:57 AM

Post #1 of 3 (999 views)
Spawning Multiple Child Processes Can't Post

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?

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.

-Kyle


FishMonger
Veteran / Moderator

Jan 30, 2011, 1:18 PM

Post #2 of 3 (995 views)
Re: [kda406] Spawning Multiple Child Processes [In reply to] Can't Post

Parallel::ForkManager - A simple parallel processing fork manager
http://search.cpan.org/~dlux/Parallel-ForkManager-0.7.9/lib/Parallel/ForkManager.pm


kda406
New User

Jan 30, 2011, 2:35 PM

Post #3 of 3 (988 views)
Re: [FishMonger] Spawning Multiple Child Processes [In reply to] Can't Post

That looks promising, and very much like what I was looking for. Thanks!
-Kyle

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives