The combination of Acquire and Release will result in a Relaxed scenario

What does the phrase 'Notice that using this ordering for an operation that combines loads and stores leads to a Relaxed store operation!' on the comment std::sync::atomic::Ordering::Acquire mean? Do you have any code examples? thank you

Atomics have operations like fetch_add or compare_exchange that first perform a read, then perform a write. For these types of operations, the read can be relaxed or acquire or seqcst, and the write can be relaxed or release or seqcst.

The comment is saying that if you mark an operation like fetch_add with Acquire, then the read will be acquire and the write will be relaxed.

2 Likes

I understand. Thank you