|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re: Proc-ProcessTable alternativeby pokki (Scribe) |
| on Oct 13, 2012 at 23:45 UTC ( #998886=note: print w/ replies, xml ) | Need Help?? |
|
Uh. You're forking with fork(), I assume? So you're probably using the standard forking idiom
or a variant thereof. The return value of fork() is, according to the perldoc, undef if the fork failed, 0 if the fork succeeded and you're in the child process, or the child's PID if the fork succeeded and you're in the parent process. So the parent process gets the forked process' PID as fork()'s return value. You can collect these every time you fork and manage your child processes however you want.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||