Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: bug in threads::shared or is it just me?

by dada (Chaplain)
on Apr 10, 2012 at 15:53 UTC ( #964351=note: print w/replies, xml ) Need Help??

in reply to Re: bug in threads::shared or is it just me?
in thread bug in threads::shared or is it just me?

well, the example is of course a stripped down test case, just to show the behaviour. in the real world, every thread makes a call to a webservice and writes the result as key/value pair in the hash. the parent of the sub then collects all results and do further processing.

I can't just remove the :shared, otherwise all data is lost to the parent when a thread ends. sure, I could share one single scalar variable for each thread and compose the hash in the sub, but that's clumsy.

and anyway, this is not even my code :-) I was just trying to help a friend, and was puzzled about the weird behaviour.


King of Laziness, Wizard of Impatience, Lord of Hubris

  • Comment on Re^2: bug in threads::shared or is it just me?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://964351]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-03-26 02:22 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (313 votes). Check out past polls.