I'm going to be building an app that spawns three system processes (Linux). They will run for an estimates 2-8 minutes, and then finish their work and exit. Pretty standard.
I'm wondering the best way of:
Any help greatly appreciated. Thanks!
If you have the extension, use the PCNTL functions. They abstract you from getting the process ids, checking their status and so.
pcntl_exec
to start the processpcntl_waitpid
with WNOHANG
option to poll their current status> /tmp/somefile 2>&1
to their command. use a different temporary filename for each process - you could generate it with tempnam()