Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://856228]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2014-08-20 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (118 votes), past polls