While I'm not an expert on threads, I believe this is the problem:
foreach my $thr (@threads) { if ( $thr->is_joinable() ) { $thr->join(); } }
You only join the threads that have already finished; instead you should join them all, i.e. wait for them to finish.
In reply to Re: What is the correct way to finish multithreaded program?
by moritz
in thread What is the correct way to finish multithreaded program?
by Gangabass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |