I'm new to multithreading in Perl 开发者_StackOverflow社区and looking for something similar to Java's thread pools. Any recommendations?
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
use threads; use threads::shared;
You can also take a look at subs::parallel module if you're interested in more transparent implementation.
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.
精彩评论