tsk1979 has asked for the wisdom of the Perl Monks concerning the following question:
This way I have multiple threads started. After this I want to wait for all threads to end, and then start processing the output files generated by the threads. Should I do something like this?for $i (0..$number) { $thr_{$i} = new Thread \&sub_routine, arg1, @array_of args; } sub sub_routine { do something; return "Thread completed successfully"; }
my @threads_return_data for $i (0 .. $number) { push @threads_return_data, $thr_{$i}->join; } post_processing_subroutine();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help on threads
by zentara (Cardinal) on Mar 22, 2006 at 12:23 UTC |