David B
David B

Reputation: 30008

What recommended multi-thread managers exist for Perl?

I'm new to multithreading in Perl and looking for something similar to Java's thread pools. Any recommendations?

Upvotes: 1

Views: 755

Answers (3)

hlynur
hlynur

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

Ask Bjørn Hansen
Ask Bjørn Hansen

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

scope_creep
scope_creep

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

Related Questions