std::atomic Extensions

Get a brief background on 'std::atomic' extensions.

In C++20, like std::atomic_ref, std::atomic can be instantiated with floating-point types such as float, double, and long double. In addition, std::atomic_flag and std::atomic can be used for thread synchronization via the member functions notify_one, notify_all, and wait. Notifying and waiting is available on all partial and full specializations of std::atomic (bools, integrals, floats and pointers) and std::atomic_ref.

Thanks to atomic<bool>, the program in the previous lesson can directly be reimplemented.

Get hands-on with 1400+ tech skills courses.