What's the difference between T, volatile T, and std::atomic<T>?
March 22, 2021
There seems to be a lot of confusion about the significance of using std::atomic<T>
over a much more straightforward volatile T
or T
. In the context of concurrency, being aware of the difference between the three cases is one fundamental cornerstone in ensuring correctness.