In python we can use multiprocessing modules. If there is a similar library in Perl and Ruby, would you teach it? I would appreciate it if you can include a brief sample.
Have a look at this nice summary page for Perl parallel processing libs http://www.openfusion.net/perl/parallel_processing_perl_modules. I like Parallel::Forker, its a modern and more powerful library than the older Parallel::ForkManager and has more features like signalling child processes. I've used it in multiple projects and it works exactly as expected. Here's an example of how to use it:
#!/usr/bin/env perl
use strict;
use warnings;
use Parallel::Forker;
my $forker = Parallel::Forker->new(use_sig_child => 1, max_proc => 4);
$SIG{CHLD} = sub {
Parallel::Forker::sig_child($forker);
};
$SIG{TERM} = sub {
$forker->kill_tree_all('TERM') if $forker and $forker->in_parent;
die "Exiting child process...\n";
};
# an example
for (1..10) {
$forker->schedule(run_on_start => sub {
# all child process code to run here
})->ready();
}
# wait for all child processes to finish
$forker->wait_all();
Hope this helps you