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

Re^2: fixed set of forked processes

by anonymized user 468275 (Curate)
on Dec 02, 2010 at 18:11 UTC ( [id://874970]=note: print w/replies, xml ) Need Help??


in reply to Re: fixed set of forked processes
in thread fixed set of forked processes

no data. not even failure or success, child capable of handling its own results. But the parent does need to know how many children are left running and update to OP: I also would prefer to avoid spawning a unix grep of unix ps to count subprocesses - that is also an unwanted overhead.

One world, one people

Replies are listed 'Best First'.
Re^3: fixed set of forked processes
by salva (Canon) on Dec 02, 2010 at 18:55 UTC
Re^3: fixed set of forked processes
by pileofrogs (Priest) on Dec 02, 2010 at 21:45 UTC

    Your parent process will know the PID of each child process, so you can kill 0, $pid to see if it's running. Not sure what the performance implications are.

    Since you were mentioning ps & grep, I thought I'd mention this simple alternative.

    If all you want is to know if children are alive or dead, you might want to look into $SIG{CHLD} which tells you when kids die. That's in perlipc too.

    --Pileofrogs

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found