I like your response a lot, because it makes perfect sense. So, in my case, I want to execute a separate script in the child process (which is the system call in the code posted). My while loop continuously grabs commands from a mysql database. In the event that a stop command is encountered, my loop will kill the child process, stopping the script that was started with a 'start' command. I agree you that a system command may be unnecessary in this case. But, with an exec call, I don't think it returns a child ID, so how would I keep track of the script and end it when the command comes in?
General Question: When I call system, there is an implicit wait call until the child finishes?
An Approach: I think someone mentioned that an array would be useful, to keep track of the child pid's. I am trying that route, because it may work in my case. Thoughts?
In reply to Re^4: Fork() Function
by carlriz
in thread Fork() Function
by carlriz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |