Why doesn't C++11 standard provide other lock free atomic structure

78 Views Asked by At

I've known that std::atomic_flag is guaranteed to be lock free whereas other atomic stuffs, such as std::atomic<int>, std::atomic<bool> are not, meaning that they may be generated with lock.

My question is why there is only one thing std::atomic_flag is lock free and others may be not? Why don't we force to use lock free to generate things like std::atomic<bool>? Is there some technique reason?

0

There are 0 best solutions below