This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimization of conditional access to globals: thread-unsafe?


Florian Weimer wrote:
* Robert Dewar:

In the following example, is the access to "Shared" considered
unsynchronized even though what looks like a proper lock is used
around it?
Yes, it is unsynchronized. Why would you think otherwise?

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, though.)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]