> Stray away from this model (e.g., relaxed atomics)
Relaxed atomics are still data-race free, did you mean non-atomic accesses?
Relaxed atomics are still data-race free, did you mean non-atomic accesses?
In fact, the raison d'être for relaxed atomics is to permit applications to create "benign data races" [in the second sense] that aren't undefined behavior. As it turns out, though, actually specifying what semantics such a "benign data race" has is complicated, especially when you get into the realm of avoiding things like out-of-thin-air behavior (or, to reference a paper that crossed my desk a month ago, undefined behavior executed only if out-of-thin-air happens).