I need to have atomic variables in my program. Previously I was using std::atomic
, but the platform in which I\'m working now does not have a g++ com
There's a good summary of the diffs here, from Herb Sutter. In summary (cut and paste):
To safely write lock-free code that communicates between threads without using locks, prefer to use ordered atomic variables: Java/.NET volatile, C++0x atomic, and C-compatible atomic_T.
To safely communicate with special hardware or other memory that has unusual semantics, use unoptimizable variables: ISO C/C++ volatile. Remember that reads and writes of these variables are not necessarily atomic, however.