|
Posted by sheinrich on April 24, 2008, 4:50 am
Please log in for more thread options wrote:
> sheinr...@my-deja.com wrote:
>
> [...]
>
> > a module that I've written couple of months ago was for that very
> > purpose.
> > Basically your script will have to instantiate anPreforkAgent, tell
> > it how many children to beget (degree of parallelization) and provide
> > it with a couple of callbacks as means of communication.
>
> Hu.. sounds pretty much like Parallel::ForkManager.
Now I got the chance to look at Parallel::ForkManager and get back on
this.
Well, the obvious difference is that PreforkAgent preforks while
Parallel::ForkManager does very much the same as fork(), only limiting
the child number and abstracting waitpid.
And as I wrote above
> > Children will live and be re-used until the job-queue is depleted.
While the Parallel::ForkManager is creating a new process on every job
(with all the performance overhead that involves), PreforkAgent does
no forking once the work 's been taken up and its children do exit
only after the last job was assigned.
The basic incentive for PreforkAgent.pm was making the most efficient
use of the host's ressources. (E. g., to wreak havoc with real big
application servers for the sake of load simulation.)
steffen
|