
19 Dec
2012
19 Dec
'12
12:28 p.m.
Andrey Semashev wrote:
All uses of READ_BARRIER or WRITE_BARRIER seem wrong, though. READ_WRITE_BARRIER is needed in all places where these are used.
Why? The intention was to prevent outer reads and writes being reordered with the atomic op. Did I miss something?
The acquire/release semantics are not specific to reads or writes. An acquire load should prevent subsequent writes from being reordered so as to precede it, and a read barrier doesn't do that, I think.