in reply to Re^2: is a readonly hash thread safe ?
in thread is a readonly hash thread safe ?
Even that reference is just a copy. See perlthrtut and/or threads::shared. Perl ithreads are based off the idea of the Win32 fork emulation, which is why every thread gets its own copy of (almost) everything. This likely is the only possible implementation anyway without risking lots of locks like Python has with its much maligned Global Interpreter Lock, as even reading a Perl variable means writing to shared memory (the refcount or integer slots for example) otherwise.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: is a readonly hash thread safe ?
by gulden (Monk) on Jul 15, 2009 at 11:12 UTC | |
by Anonymous Monk on Jul 15, 2009 at 11:22 UTC | |
|
Re^4: is a readonly hash thread safe ?
by cbrauner (Novice) on Jul 15, 2009 at 12:37 UTC | |
by Corion (Patriarch) on Jul 15, 2009 at 12:48 UTC |