2 ms·
From "Nine ways to break your systems code using volatile" at http://blog.regehr.org/archives/28 http://blog.regehr.org/archives/28 "You can find various rants
by Symmetry 16y ago
From "Nine ways to break your systems code using volatile" at http://blog.regehr.org/archives/28 http://blog.regehr.org/archives/28
"You can find various rants, screeds, and diatribes against volatile on Linux mailing lists and web pages. These are largely correct, but you have to keep in mind that:
Linux often runs on out-of-order multicores where volatile by itself is nearly useless.
The Linux kernel provides a rich collection of functions for synchronization and hardware access that, properly used, eliminate almost all need for volatile in regular kernel code.
If you are writing code for an in-order embedded processor and have little or no infrastructure besides the C compiler, you may need to lean more heavily on volatile."