3 ms·
using volatile correctly usually means you're manipulating write-combining memory. Write-combining memory has weak memory ordering where all writes are delayed
by mgaunard 4y ago
using volatile correctly usually means you're manipulating write-combining memory.
Write-combining memory has weak memory ordering where all writes are delayed so anything doing both reads and writes is most likely going to bite you in the neck.
- munch117 4y agoIf you're accessing any kind of I/O register or special memory, obviously you need to know the rules of engagement for the particular kind. If you don't, then you're just going to be making the same mistake in a less obvious guise. Like writing *v=*v+1 instead of *v++.