I have several blocks of code inside the function of some object that can work in parallel and speed up work for me.
I tried using subs::parallelas follows (all this in the function body):
my $is_a_done = parallelize {
return 1;
};
my $is_b_done = parallelize {
return 1;
};
my $is_c_done = parallelize {
if ($is_a_done) {
};
return 1;
};
my $is_d_done = parallelize {
return 1;
};
if ($is_a_done && $is_b_done && $is_c_done && $is_d_done) {
}
First, note that I use ifto wait until threads block and wait for the previous thread to finish when it is needed (best idea? ifPretty ugly ...).
Secondly, I get an error message:
Thread already joined at /usr/local/share/perl/5.10.1/subs/parallel.pm line 259.
Perl exited with active threads:
1 running and unjoined
-1 finished and unjoined
3 running and detached
source
share