The Atomic Flag

This lesson gives an overview of the atomic flag, which is used from the perspective of concurrency in C++.

We'll cover the following...

The atomic flag, i.e. std::atomic_flag, has a very simple interface. Its clear method enables you to set its value to false; with the test_and_set method you can set the value back to true. There is no method to exclusively ask for the current value. To use std::atomic_flag it must be initialized to false with the constant ATOMIC_FLAG_INIT. std::atomic_flag has two outstanding properties.

std::atomic_flag is:

...
Access this course and 1400+ top-rated courses and projects.