
Net::Scan::Fork - A simple way to manage fork processess.

use Net::Scan::Fork;
bla bla
bla bla
Net::Scan::Fork::settings(20,4,3,60);
foreach (@hosts){
Net::Scan::Fork::scan(\&scan,100,$_);
}
Net::Scan::Fork::wait_child;
exit(0);
sub scan{
bla bla
bla bla
}

This module provides you a simple way to manage fork processess. It would be useful in a multiprocess network/security/etc. scanner.

Fork settings:
Net::Scan::Fork::settings(20,4,3,60);
You can specify:
set a new "max processes" value when the "critic cpu load" has been passed. 20 is a good value;
when the "critic cpu load" has been passed, the number of processes is decreased to "new max processes" and a sleep of seconds ("sleep time") takes place. 4 is a good value;
is the new limit of the cpu load to check when the critic value has been passed. 3 is a good value;
sleep time (in seconds) when the "critic cpu load" value is exceeed; 60 is a good value;
This function executes the code reference passed to it. 100 is the max number of processes value;
Net::Scan::Fork::scan(\&scan,100,$ip);
Wait for all the processes which have been forked.
Net::Scan::Fork::wait_child;

A high value of processes could increase too much the cpu load and block the sistem :)
Please send me your feedback.

Proc::Fork Parallel::ForkManager

Matteo Cantoni, <mcantoni@cpan.org>

You may distribute this module under the terms of the Artistic license. See Copying file in the source distribution archive.
Copyright (c) 2006, Matteo Cantoni