in reply to Re^3: is a readonly hash thread safe ?
in thread is a readonly hash thread safe ?

i pass a hash-reference to the thread, so the thread gets (a copy of) the reference - BUT the data referenced by the hash-reference should be only once in memory ?

Replies are listed 'Best First'.
Re^5: is a readonly hash thread safe ?
by Corion (Patriarch) on Jul 15, 2009 at 12:48 UTC

    No. The reference is a copy of the reference, and the data is a copy of the referenced data. Again, see perlthrtut, and threads::shared. Threads don't share things as you might come to expect if you think of C-level threads.