Created
November 17, 2016 09:45
-
-
Save khan5v/7d54becdab184873e35bd5e2c6875e59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Parallel::SubFork; | |
use Data::Dumper; | |
my $manager = Parallel::SubFork->new(); | |
for(1..10) { | |
$manager->start(\&cb, [$_]); | |
} | |
$manager->wait_for_all(); | |
sub cb { | |
my $args = shift; | |
print "($$) has started with arguments:\n"; | |
print Dumper $args || "No args\n"; | |
for(1..$args->[0]*1000) { | |
my $x = $_ + 123; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment