Just another Perl shrine | |
PerlMonks |
Success!by Clownburner (Monk) |
on Mar 22, 2001 at 05:03 UTC ( [id://66203]=note: print w/replies, xml ) | Need Help?? |
Thanks in large part to Chipmunk's efforts, I was able to figure out a few optimizations to make this work without resorting to the 'full-blown forking process handler' approach. Perhaps this is oversimplified and I missed something important; if that's the case, please please let me know before I put this code into production. After correcting the logic to use the child status ($?) to increment/not increment the counter for status, I fixed the forking so that the parent wouldn't wait for each child, to improve speed. To prevent the resulting fork()bomb, I devised a clever (to me) way to subdivide the array @targets into chunks that I could use to get exactly as many clients as I needed, but no more. I then used a global variable ($i) to index the array so that each child got called on a separate target, and no target got checked more than once. If anyone has any further optimizations, please share!
Signature void where prohibited by law.
In Section
Seekers of Perl Wisdom
|
|