![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Disclaimer: this is based purely on reading, not real experience ;^) The model of threading in 5.8, ithreads, completely separates variables created in one thread from those in other threads. Much like forked processes, ithreads duplicate data rather than share it unless explicitly told to do so. I believe the reason for this approach is due to a vast quantity of Perl code having been written without consideration for thread safety. ithreads separate data to prevent race conditions when multiple threads manipulate the same object. So, I believe what you'll need to do is declare your variable $HS like: or
If this doesn't answer your question, perhaps you could post the relevant sections of code.
In reply to Re: Threads and object access
by djantzen
|
|