This is the mail archive of the
mailing list for the GCC project.
Re: Optimization of conditional access to globals: thread-unsafe?
Florian Weimer wrote:
* Robert Dewar:
Yes, it is unsynchronized. Why would you think otherwise?
In the following example, is the access to "Shared" considered
unsynchronized even though what looks like a proper lock is used
The signaling rules are dynamic, not static. Only the code path that is
actually taken matters. Sam's corrected code only updates Shared if the
operation in other tasks have been signaled (because of the entry_body
rule and the sequence rule).
I don't understand, are we looking at the same example, the example
from Sam that I looked at did not have an entry body, so how could the
entry body rule apply?
(I can't reproduce the conditional store with my GCC 4.2 installation,