Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Parent process does not wait for Child processes to finish and exits after the waitpid statement

by bart (Canon)
on Feb 06, 2012 at 20:04 UTC ( #952145=note: print w/ replies, xml ) Need Help??


in reply to Parent process does not wait for Child processes to finish and exits after the waitpid statement

  • You're using Win32::Process so you're probably running this on Windows. I have my doubts if using a Unix mechanism on Windows is the best way to do it, or even if it'll work well.
  • Actually, fork on Windows doesn't start a new program. It starts a new thread.
  • Next, you're calling exec in the child process thread. exec doesn't return.
  • What does running an LWP request have to do with anything? OK, I'm officially confused now.
In short: if this is Windows, I think your program is killed by exec in the child.


Comment on Re: Parent process does not wait for Child processes to finish and exits after the waitpid statement
Re^2: Parent process does not wait for Child processes to finish and exits after the waitpid statement
by scriptstudent (Initiate) on Feb 07, 2012 at 15:42 UTC
    Thanks for the comments... I did not realize that fork() may have issues on the windows platform. I would try spawning a thread for each process and then have the parent wait for those threads to exit. Would also need to capture the exit status of the parent if exiting abruptly. Thanks again..

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952145]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (19)
As of 2014-10-20 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (89 votes), past polls