Help for this page

Select Code to Download


  1. or download this
        my $thr = threads->create({'context' => 'list'}, \&foo);
        ...
        my @results = $thr->join();
    
  2. or download this
        my $thr = threads->create({'context' => 'void'}, \&foo);
        ...
        $thr->join();
    
  3. or download this
        threads->create({'scalar' => 1}, \&foo);
        ...
        my ($thr) = threads->list();
        my $result = $thr->join();
    
  4. or download this
        # Create thread in list context
        my ($thr) = threads->create(...);
    ...
    
        # Create thread in void context
        threads->create(...);