- or download this
threads->create( \&JobAdder, $q, $maxJobs, [ 0 .. 99 ] );
- or download this
AddJob( $q, shift @$inputs );
- or download this
$q->enqueue( [@_] );
- or download this
while( defined( my $argRef = $q->dequeue ) ) {
- or download this
$callBack->( @$argRef );
- or download this
sub GetFibby {
my( $chunkId ) = @_;
use autodie qw/ open close /;
open my( $outfh ), '>', "fibojob-$chunkId.txt";
- or download this
$q->enqueue( 0 .. 99 );
- 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.