Closed korawend closed 6 months ago
I think this "data accesses" (allusion to "data race", probably) refers to non-atomic memory accesses as defined by the C++ memory model, which don't have a defined behavior unless properly ordered by atomic memory accesses (which can be read, write, or read-modify-write operations) or other means.
On the page for Atomics, the Nomicon claims that
but I'm not certain this is true; at least, I was under the impression that with ordinary stores, loads, and memory barriers (but without atomics or the ability to lock the memory bus), it was still possible to synchronize multiple threads using e.g. Dekker's algorithm.
Because of the strength of the statement ("it is literally impossible"), I took this to mean that even the compiler, or a user working with a compiler that did not perform optimizations or re-ordering, would be incapable of synchronizing two threads – which is different than saying "you can't reliably synchronize two threads using Rust and the rustc compiler (without the use of Rust's atomics)".