Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
Do you know where your variables are?
 
PerlMonks  

Re: Parallel::ForkManager leaves a zombie process from last child

by vsespb (Hermit)
on May 30, 2013 at 20:54 UTC ( #1036141=note: print w/ replies, xml ) Need Help??


in reply to Parallel::ForkManager leaves a zombie process from last child

anyway, this seems to work better

while (1) { $pm->start and next; while ($inputcon = $daemon->accept()) { do_client_stuff($inputcon); } $pm->finish(); }
it reuses processes and I don't see zombies.


Comment on Re: Parallel::ForkManager leaves a zombie process from last child
Download Code
Re^2: Parallel::ForkManager leaves a zombie process from last child
by sundialsvc4 (Monsignor) on May 31, 2013 at 10:55 UTC

    Run a process-monitor, now, and see which how many threads are running at 100% CPU utilization ... without me dumpster-diving right now into the guts of P::FM, I think you’ll find one if not many.

      Run a process-monitor, now, and see which how many threads are running at 100% CPU utilization
      Actually none. Everything is OK. CPU is 0% for all processes.
        OK, thank you guys. Case closed.
Re^2: Parallel::ForkManager leaves a zombie process from last child
by ikegami (Pope) on Jun 01, 2013 at 23:15 UTC

    You find 1 yet-to-be reaped process wasteful, but you're ok with having N blocked processes??? I don't think you know what you want!!!

    That said, this is a better solution. You fork *before* a connection comes in, so there's less lag in handling a response. And since you reuse the child process, you don't waste time forking repeatedly. One might wonder why P::FM is used at all, but it causes children that die for whatever reason to be restarted, so you always have a full pool of children waiting!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-04-18 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (462 votes), past polls