- MCE
- fork
MCE - Many-Core Engine
- On Debian/Ubuntu it is called libmce-perl
examples/forks/use_mce.pl
use strict; use warnings; use MCE; main(); sub main { my ($workers) = @ARGV; die "Usage: $0 WORKERS\n" if not defined $workers; my $mce = MCE->new( max_workers => $workers, user_func => sub { my ($mce) = @_; $mce->say("Hello from PID $$ WID " . $mce->wid); } ); $mce->run; }
$ perl use_mce.pl 5
Hello from PID 210834 WID 2 Hello from PID 210833 WID 1 Hello from PID 210835 WID 3 Hello from PID 210836 WID 4 Hello from PID 210837 WID 5