in reply to Re^2: is ||= threadsafe?
in thread is ||= threadsafe?
It happens internally in the perl code, which is guaranteed to be thread safe
||= happens in Perl code, yet it's not thread safe for shared variables.
You may say that's because it's the user requesting a change the variable, but that's the case for all the examples I showed too.
Now, tye and BrowserUk say the shared SV is appropriately locked internally when updated (and I believe it to be true), so that eliminates the potential problems I posited, so the point is simply that your guarantee is worthless as formulated.
That's probably because you pulled the guarantee out of this air. When I looked this up some time ago, I couldn't find any documentation on this. A very quick look still shows nothing. This is why I prompted for replies on the subject.
Update: Added everything after first line.
Update: Added "for shared variables" in response to reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: is ||= threadsafe?
by BrowserUk (Patriarch) on Oct 25, 2010 at 17:29 UTC | |
by ikegami (Patriarch) on Oct 25, 2010 at 17:46 UTC | |
by tye (Sage) on Oct 25, 2010 at 19:43 UTC | |
by ikegami (Patriarch) on Oct 25, 2010 at 22:02 UTC | |
by BrowserUk (Patriarch) on Oct 25, 2010 at 18:45 UTC | |
by ikegami (Patriarch) on Oct 25, 2010 at 21:59 UTC | |
by BrowserUk (Patriarch) on Oct 25, 2010 at 22:38 UTC |