Help for this page

Select Code to Download


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