Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: shared complex scalars between threads

by aufflick (Deacon)
on Oct 15, 2008 at 23:50 UTC ( #717369=note: print w/replies, xml ) Need Help??


in reply to shared complex scalars between threads

The two above give good suggestions. Your problem at the moment, I think, is that you are only sharing that variable - any deep structure is not shared. See this from threads::shared:

"share" will traverse up references exactly one level. "share(\$a)" is equivalent to "share($a)", while "share(\\$ +a)" is not. This means that you must create nested shared data st +ructures by first creating individual shared leaf notes, then adding + them to a shared hash or array.

I haven't tried it, but as BrowserUK points out the newer versions of threads::shared claim to do what you want.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2023-09-23 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?