Help for this page
use threads (); use threads::shared (); ... push( @thread,threads->new( sub { $scalar++ for 1..100000 } ) ) for 1. +.10; $_->join foreach @thread; # wait for all threads to finish print "scalar = $scalar\n";
use threads (); use threads::shared (); ... } ) ) for 1..10; $_->join foreach @thread; # wait for all threads to finish print "scalar = $scalar\n";