On Fri, 7 Jul 2006 17:22:31 -0400, "linux-os \(Dick Johnson\)" <linux-os@xxxxxxxxxxxx> wrote:
On Fri, 7 Jul 2006, Linus Torvalds wrote:
On Fri, 7 Jul 2006, linux-os (Dick Johnson) wrote:
Now Linus declares that instead of declaring an object volatile
so that it is actually accessed every time it is referenced, he wants
to use a GNU-ism with assembly that tells the compiler to re-read
__every__ variable existing im memory, instead of just one. Go figure!
Actually, it's not just me.
Read things like the Intel CPU documentation.
IT IS ACTIVELY WRONG to busy-loop on a variable. It will make the CPU
potentially over-heat, causing degreaded performance, and you're simply
not supposed to do it.
This is a bait and switch argument. The code was displayed to show
the compiler output, not an example of good coding practice.
volatile means what it means, is usefull and is right. If it is used
in kernel for other things apart from what it was designed for it is
kernel or programmer responsibility. It does not mention nothing about
locking.