in reply to background system() and stillalive() sub
With unix you can start multiple processes "in the background".
$> program_a 1 2 &
$> program_a 3 4 &
A Unix process started in this way runs at a lower priority than the process that started it. Also I think, if you die, they die also. This is different than a detached separate process which will keep running even if you die. A process like that can even have a higher priority than the process that launched it.
You can scan the pid table (ps command) to see if program_a is still running. What is the need to determine which instance of program_a is running? Does it really matter if you can identify that the instance of program_a which was called with parms 1 2 vs 3 4 is running? Maybe not? Maybe so?
If Perl can't deliver the PID of a new process, you can scan process table and then re-scan to see the new PID that shows up when Perl says "hey", system command worked".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: background system() and stillalive() sub
by cdarke (Prior) on Aug 02, 2009 at 12:36 UTC | |
by Marshall (Canon) on Aug 02, 2009 at 13:09 UTC |