Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://952145]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found