|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Comment on |
| ( #3333=superdoc: print w/ replies, xml ) | Need Help?? |
|
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.
cheers, Aldo King of Laziness, Wizard of Impatience, Lord of Hubris In reply to Re^2: bug in threads::shared or is it just me?
by dada
|
|