Help for this page

Select Code to Download


  1. or download this
        threads->create( \&JobAdder, $q, $maxJobs, [ 0 .. 99 ] );
    
  2. or download this
            AddJob( $q, shift @$inputs );
    
  3. or download this
        $q->enqueue( [@_] );
    
  4. or download this
        while( defined( my $argRef = $q->dequeue ) ) {
    
  5. or download this
            $callBack->( @$argRef );
    
  6. or download this
    sub GetFibby {
        my( $chunkId ) = @_;
        use autodie qw/ open close /;
        open my( $outfh ), '>', "fibojob-$chunkId.txt";
    
  7. or download this
    $q->enqueue( 0 .. 99 );
    
  8. or download this
    #! perl -slw
    use strict;
    ...
    $Q->nq( 0 .. $M );                                               ## Qu
    +eue some work.
    $Q->nq( ( undef ) x $T );                                        ## Te
    +ll the workers they are done.
    $_->join for @threads;                                           ## An
    +d wait for them to finish.