As we've discussed before, allocation of shared objects (i.e. structs and arrays) must include whatever barriers are necessary to guarantee that other threads will not read uninitialized fields. But must these barriers provide any other guarantees?
Consider this execution where x and y are distinct and *x starts out as 0:
T1 | T2
(A) *x = 1 |
(B) *y = new $foo |
| (C) r1 = (*y).bar (reads value from B)
| (D) r2 = *x
Is r2 allowed to be 0, or must it be 1?
Since (C) is not an acquire load, I hope that the answer is that 0 is allowed and that it would be perfectly valid to reorder (C) and (D) and/or reorder (A) and (B). @conrad-watt, is that right?