my $shared = MCE::Shared->scalar(0); sub task { $shared->incrby(1); } MCE::Hobo->init( max_workers => 8, posix_exit => 1 ); MCE::Hobo->create( \&task, $_ ) for 0 .. 41; MCE::Hobo->wait_all; END { print "The answer is $shared\n"; }