for($ii=0;$ii<=$count;$ii++) { $thr="thread".$ii; print $thr,"\n"; # $$thr->join(); # don't join here } make a loop that waits for each thread as they finish # JOIN ALL THREADS # untested, but close :-) my @returns; while(1) foreach my $thread (threads->list) { if ($thread->is_joinable() ) { push @returns, $thread->join; } if( scalar (threads->list) == 0 ) { last} } print "@returns\n"; __END__
In reply to Re: Trouble implementing threads
by zentara
in thread Trouble implementing threads
by saranrsm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |