If Parallel::Queue's threading worked for me I'd suggest the following.
use threads::shared; use Parallel::Queue; print concatenate_parallel( ['a' .. 'z'], 4 ) . "\n"; sub concatenate_parallel { my $result :shared; my @input = map { my $string = $_; sub { $result .= $string; }; } @{ shift @_ }; my $max_threads = shift @_; my $mgr = Parallel::Queue->construct( 'thread' ); $mgr->runqueue( $max_threads, @input ); return $result; }
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re: using parallel processing to concatenate a string, where order of concatenation doesn't matter
by diotalevi
in thread using parallel processing to concatenate a string, where order of concatenation doesn't matter
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |