Reputation: 30008
I'm new to multithreading in Perl and looking for something similar to Java's thread pools. Any recommendations?
Upvotes: 1
Views: 755
Reputation: 596
use threads; use threads::shared;
You can also take a look at subs::parallel module if you're interested in more transparent implementation.
Upvotes: 1
Reputation: 6953
If you really want threads, then look at threads.pm and threads::shared.
However -- Perl doesn't have lightweight threads like Java and few people (relatively) use them. Many "thread problems" can be solved (often better, too) with event based programming.
Look for AnyEvent for that: http://search.cpan.org/search?query=anyevent&mode=all
Upvotes: 2
Reputation: 4251
Well CPAN, which contains all things perl(ish) has a thread pool implementation, Thread::Pool
. There is another implementation, but it's currently not production code.
Upvotes: 0