P
Peter Valdemar Mørch
perldoc perlmodlib suggests posting here before posting on CPAN, so
here goes:
I have a new module that I'd like to upload: Parallel::Loops, and
following is the bulk of the synopsis. Is the Parallel::Loops name
appropriate and does anybody have any comments on it before I post it
on CPAN?
Its repository can be found here (code, complete perldoc, etc.)
http://github.com/pmorch/perl-Parallel-Loops
Synopsis:
use Parallel::Loops;
my $maxProcs = 5;
my $pl = new Parallel::Loops($maxProcs);
my @input = ( 0 .. 9 );
my %output;
$pl->tieOutput( \%output );
$pl->foreach(
\@input,
sub {
# This sub "magically" executed in parallel forked child
# processes
# Lets just create a simple example, but this could be a
# massive calculation that will be parallelized, so that
# $maxProcs different processes are calculating sqrt
# simultaneously for different values of $_ on different CPUs
$output{$_} = sqrt($_);
}
);
here goes:
I have a new module that I'd like to upload: Parallel::Loops, and
following is the bulk of the synopsis. Is the Parallel::Loops name
appropriate and does anybody have any comments on it before I post it
on CPAN?
Its repository can be found here (code, complete perldoc, etc.)
http://github.com/pmorch/perl-Parallel-Loops
Synopsis:
use Parallel::Loops;
my $maxProcs = 5;
my $pl = new Parallel::Loops($maxProcs);
my @input = ( 0 .. 9 );
my %output;
$pl->tieOutput( \%output );
$pl->foreach(
\@input,
sub {
# This sub "magically" executed in parallel forked child
# processes
# Lets just create a simple example, but this could be a
# massive calculation that will be parallelized, so that
# $maxProcs different processes are calculating sqrt
# simultaneously for different values of $_ on different CPUs
$output{$_} = sqrt($_);
}
);