Better understanding atomics

Rust uses the C++ model for atomics, so if they disagree, the C++ rules take precedence.

That said, the rules you mention here are phrased in terms of "so and so optimization can't happen", but this kind of language can never be a precise way to describe the rules that atomics follow. It is only used for summaries. Read the actual rules to see what the actual rules are.

4 Likes