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

Re: Parallel::Runner and Amazon SQS Issue

by remiah (Hermit)
on Sep 12, 2012 at 23:21 UTC ( #993325=note: print w/ replies, xml ) Need Help??


in reply to Parallel::Runner and Amazon SQS Issue

Hello.

$last_seen is incremented in pararell process currently.

for my $workerid (1..$max_workers) {
  $runner->run( sub {
      #query and push queue
      $last_seen += $page_size;
  }
}
Do you mean like this?
for my $workerid (1..$max_workers) {
  $runner->run( sub {
      #query and push queue
  }
  $last_seen += $page_size;
}


Comment on Re: Parallel::Runner and Amazon SQS Issue
Re^2: Parallel::Runner and Amazon SQS Issue
by stonecolddevin (Vicar) on Sep 13, 2012 at 01:28 UTC

    It would seem to me that I'd want to update in the parallel process, otherwise it only gets updated for however many children there are, not for however many items in the dataset there are.

    Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

      It seems to me, you are looking for shared variable and lock facility for ipc processes. If threads::shared is what you are looking for, please see example of zentra and example of BrowserUK and documents for thread.

      It is pity of me not well educated myself for threads, to say something... I hope it helps you.

        Thanks a bunch remiah, I think you are ultimately on the right track. I'll look into these nodes.

        I appreciate your help!

        Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-08-01 02:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls