Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Proc-ProcessTable alternative

by pokki (Monk)
on Oct 13, 2012 at 23:45 UTC ( #998886=note: print w/ replies, xml ) Need Help??

in reply to Proc-ProcessTable alternative


You're forking with fork(), I assume? So you're probably using the standard forking idiom

if (my $pid = fork()) { # do stuff in the parent } else { # do stuff in the child }

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.

Comment on Re: Proc-ProcessTable alternative
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998886]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-11-29 13:41 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (751 votes), past polls