David Leimbach wrote:

Volatile is useful for telling compilers not to stick data in registers, which is helpful for multi-threaded situations with shared memory ... sometimes :)

and, stuff that tickles hardware. Refer to the old crazy stuff bsd did in the early 80s to get around those issues and still optimize drivers. Now, wonder if that script could even be found at this point.

I think I missed the part of the discussion that explains how to do mmap'ed I/O without volatile, and a good idea of how to tweak the compiler, such that:

while (x->statux & BUSY)
        ;

works. If the answer is "don't optimize that functions, you idiot!" I'm actually ok with that.

ron

Reply via email to