Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Reaping Zombies

by salva (Canon)
on Feb 15, 2006 at 19:23 UTC ( #530476=note: print w/replies, xml ) Need Help??

in reply to Re^2: Reaping Zombies
in thread Reaping Zombies

It seems to be expensive it terms of CPU usage

What do you mean exactly? have you found the waitpid system call to be expensive, or are you talking about the full process?

What else are you doing inside the while loop besides calling the reaper? You should be calling sleep or select or any other thing that causes your program to do nothing for a while!

Replies are listed 'Best First'.
Re^4: Reaping Zombies
by ikegami (Patriarch) on Feb 15, 2006 at 19:36 UTC
    If nothing else is done in the loop, just remove WNOHANG instead of sleeping.
Re^4: Reaping Zombies
by dsb (Chaplain) on Feb 15, 2006 at 19:33 UTC
    Well I'm thinking it's the call to waitpid().

    I've only just added the multi-threaded processing and the script was using a lot of CPU. With the reaper code, it running at 20-30% CPU usage...eesh

    This @ISA my( $cool ) %SIG
      but are you doing anything else inside the while loop or just calling the reaper?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2022-01-28 11:52 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (73 votes). Check out past polls.