I understand that std::atomic<>
is an atomic object. But atomic to what extent? To my understanding an operation can be atomic. What exactly is meant by making an object atomic? For example if there are two threads concurrently executing the following code:
a = a + 12;
Then is the entire operation (say add_twelve_to(int)
) atomic? Or are changes made to the variable atomic (so operator=()
)?