|
|
|
|
|
by vvanders
3956 days ago
|
|
Volatile works correctly on all platforms. Don't use it as a synchronization primitive, that's not what it's meant to do. You only should use it: a. If you're reading from HW. b. If you want to use it like a const marker for member functions. |
|
1. Reading or writing shared memory
2. Values which may be modified in signal handlers
3. Implementing atomic types (e.g. boost::atomic)
4. RCU (e.g. ACCESS_ONCE in Linux kernel)