in reply to Re^4: Need help with Perl multi threading
in thread Need help with Perl multi threading
With regard to:
foreach my $host ( @servers ) { threads->new(\&process, $host )->join(); }
... creating a new thread and then immediately joining it is a waste of time; join waits for the thread to finish.
In this case, detach is probably better. Otherwise, keep an array of all threads and after you've created all of them, then join all of them.
Improve your skills with Modern Perl: the free book.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Need help with Perl multi threading
by ashok.g (Beadle) on Jan 27, 2012 at 11:55 UTC | |
by chromatic (Archbishop) on Jan 27, 2012 at 20:09 UTC | |
|
In Section
Seekers of Perl Wisdom