Quantcast
Channel: What exactly is std::atomic? - Stack Overflow
Viewing all articles
Browse latest Browse all 4

What exactly is std::atomic?

$
0
0

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=())?


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images