laziness, impatience, and hubris | |
PerlMonks |
Re: Threads weirdnessby Corion (Patriarch) |
on Jul 06, 2009 at 14:12 UTC ( [id://777555]=note: print w/replies, xml ) | Need Help?? |
Passing around objects among threads is fraught with potential for errors. I think the basic principle is that you'll get a copy unless you declare something as explicitly :shared. See threads and threads::shared. Personally, I'd try to decouple the scheduler from the worker(s) and have a queue in each direction to pass commands forth and receive the status (+data) back from the worker(s).
In Section
Seekers of Perl Wisdom
|
|