- or download this
for(my $i=0; $i<MAX_THREADS; $i++) {
threads->create( \&thread, $q )->join;
}
- or download this
thread( $q );
thread( $q );
...
thread( $q );
thread( $q );
thread( $q );
- or download this
my @threads = map threads->create( \&thread, $q ), 1 .. MAX_THREADS;
$_->join for @threads;