What does memory_order_relaxed actually guarantee?
hard~25 min#atomics#c++#concurrency#memory-model
A colleague has changed every atomic operation in a hot path to std::memory_order_relaxed because "the benchmarks got faster and the tests still pass".
What does relaxed still guarantee, what has it given up, and how would you decide whether this change is safe?
Solution — locked
Sign in to unlock this one
The solution opens once you explain the idea in your own words and it passes the grader — which needs an account to record. Signing in is free.
Log in