Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Working in parallel

by BioLion (Curate)
on Aug 20, 2010 at 09:50 UTC ( #856228=note: print w/replies, xml ) Need Help??

in reply to Working in parallel

Check out CPAN - there are modules for helping run and manage children :

  1. Parallel::ForkManager (one of the simplest)
  2. Parallel::Forker (allows a lot more fine grained control)
  3. There are a lot of others too, which may suit your needs more or less, so take time to browse...

There are also a number of IPC modules :

  1. perlipc has a lot more details
  2. e.g. IPC::Shareable
  3. I have had good results with this one, but there are a lot others and I might be a bit out of date!

Hope this helps - let us know if you get a bit further and still have problems/questions!

Just a something something...

Replies are listed 'Best First'.
Re^2: Working in parallel
by Anonymous Monk on Aug 20, 2010 at 11:23 UTC
    Thank you for your quick reply! I've looked into Parallell::ForkManager and IPC::Shareable but unfortunately they use Storable to exchange data (even worse, forkmanager writes Storable data onto disk :)) Then I've found subs::parallel which looks promising, and AFAIK doesn't use serialization.
    use Data::Dumper; use subs::parallel; my $baz = parallelize { my $h = {foo => 3}; return $h; }; # returns immediately $baz and 1; # blocks print Dumper $baz;

      subs::parallel is *really* cute. It's been around since 2005, and yet I've never seen it before.

      So amazingly simple and yet so very powerful. Thanks for bringing to the community's attention.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://856228]
[vedagiri89]: CentOS Linux release 7.0.1406 (Core)
[hippo]: How did you install libapreq2?
[vedagiri89]: that one is done by system team from the tar i guess
[hippo]: Really? Not using the one from the CentOS repository? Perhaps that's the problem.
[vedagiri89]: i need when this issue will come usually
[hippo]: How about mod_perl? Was that installed from the CentOS packge or from source?
[vedagiri89]: from the source
[hippo]: But is under vendor_perl in your error message so you are mixing up modules installed from the packager and by hand. That's rarely a good plan.
[vedagiri89]: the prm fine if i run file directly..not working if i run through apache http file

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2018-06-19 11:35 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (113 votes). Check out past polls.