|
|
|
|
|
by ridiculous_fish
3957 days ago
|
|
Here are some other places where volatile is appropriate: 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) |
|
Really you should be using the appropriate platform memory and execution barriers in place of volatile 99% of the time.