good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
We had a similar issue in the past with a perl daemon that forked multiple working children to handle various tasks. Obviously the larger you forking process is the larger the children. His solution was to have the daemon imediatly fork off the "main" process and keep the small initial parent just for the job of forking new processes. If the main program needed another process it would ask the original parent to do it for it. As all the parent was doing was forking new processes it remained nice and small.
He also got to call it a realy cool name. "The Motherforker!" :-) _____________________ Remember that amateurs built Noah's Ark. Professionals built the Titanic. In reply to Re: threads: spawn early to avoid the crush.
by vagnerr
|
|