On 23/11/11 23:43, Richard Henderson wrote:
+/* Split a compare and swap pattern.  It is IMPLEMENTATION DEFINED whether
+   another memory store between the load-exclusive and store-exclusive can
+   reset the monitor from Exclusive to Open state.  This means we must wait
+   until after reload to split the pattern, lest we get a register spill in
+   the middle of the atomic sequence.  */

An implementation is also permitted to clear the exclusive monitor for other reasons, including cache maintenance. Therefore no explicit load should appear between load exclusive and store exclusive.

These sequences were written as opaque sequences to ensure that loads and stores were not injected by reload or subsequent passes. Would the addition of blockages around each load exclusive and store exclusive be sufficient to guarantee no load or store was scheduled between the exclusives?

/Marcus

Reply via email to