Help for this page

Select Code to Download


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