Question 11
Back to Exercise
When is std::atomic a good replacement for a mutex?
- A When several variables must change together
- B For a single independent counter or flag Correct
- C For protecting a std::map
- D Never
Correct Answer: Option B
Two atomics updated one after the other are not one atomic operation.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!