Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Reaping Zombies

by dsb (Chaplain)
on Feb 15, 2006 at 19:00 UTC ( #530470=note: print w/ replies, xml ) Need Help??


in reply to Re: Reaping Zombies
in thread Reaping Zombies

The reaper code I'm using is identical to what I posted...It seems to be expensive it terms of CPU usage. Did you have a similar issue?


dsb
This @ISA my( $cool ) %SIG


Comment on Re^2: Reaping Zombies
Replies are listed 'Best First'.
Re^3: Reaping Zombies
by salva (Abbot) on Feb 15, 2006 at 19:23 UTC
    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!

      If nothing else is done in the loop, just remove WNOHANG instead of sleeping.
      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


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-31 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls