Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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...

Comment on Re: Working in parallel
Download Code
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]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2015-11-29 07:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (748 votes), past polls