
27 Aug
2011
27 Aug
'11
5:52 p.m.
on Sat Aug 27 2011, Gottlob Frege <gottlobfrege-AT-gmail.com> wrote:
There is no "synchronizes with" (standard's wording) because synch-with requires thread 2 to *read* the value written into the atomic by thread 1. We have no reads here - no if statement - so reordering doesn't matter. I don't think the standard disallows the reordering of i and j, even if they are atomics.
IIUC from the point of view of programs without undefined behavior, the standard disallows reordering in both cases. -- Dave Abrahams BoostPro Computing http://www.boostpro.com