5 ms·
You're right, but what I meant about it was that just because the variable is const, doesn't mean it can't change from somewhere else between reads. Even if you
by bstamour 7y ago
You're right, but what I meant about it was that just because the variable is const, doesn't mean it can't change from somewhere else between reads. Even if you use synchronization to avoid data races, if you read the pointer to const twice in the function, it could change between the reads.
- SAI_Peregrinus 7y agoThe most common example of that is probably a const volatile variable for the input data register of some peripheral. New data can come in at any time, and writes do nothing.