Open
Description
I was surprised that we don't have a recommendation on this in the concurrency section.
The gist of it is that you should prefer std::atomic<bool>
by default. std::atomic_flag
is guaranteed to be lock-free, but it also has a less usual API and is lock-free at all cost, even if that means doing something insanely costly like locking the entire memory bus.
Metadata
Metadata
Assignees
Labels
No labels