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: Advanced:
How the parent process knows that all its child process has finished execution?

 



kishore036
New User

May 24, 2008, 4:55 AM

Post #1 of 2 (2006 views)
How the parent process knows that all its child process has finished execution? Can't Post

 
Hello,

The parent process fork's and creates 30-40 child process to process 30-40 files. The parent process has to wait until all child process have completed processing the files.
The proble is how long the parent process has to wait? or how will the parent process know that all child process has finished execution?

Thanks,

Kishore D


winfinit
User

May 30, 2008, 11:31 AM

Post #2 of 2 (1977 views)
Re: [kishore036] How the parent process knows that all its child process has finished execution? [In reply to] Can't Post

look into SIGNALS and you can wait for a child with "waitpid" so you never have to go sleep at your parent if you are using waitpid, that will just sleep for you, and as soon as $SIG{CHLD} is triggered waitpid will get its return( if needed) and continue with rest of the actions.
http://perldoc.perl.org/functions/waitpid.html

 
 


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

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