Subj : Re: Memory Barriers, Compiler Optimizations, etc. To : comp.programming.threads From : Scott Meyers Date : Sat Feb 05 2005 09:05 am On Sat, 5 Feb 2005 02:22:51 +0200, Ziv Caspi wrote: > Others (many of them on this group) contend that C/C++ is explicitly *not* > about MT programs, and you can't rely on any guarantees. Well, the C++ standard seems pretty clear to me that the sequence of reads and writes to volatile data separated by sequence points must be preserved by a conforming compiler. I can't tell from a quick glance whether the C99 standard offers the same guarantee. So what is the basis for the "can't rely on any guarantees" camp? That there are many nonconforming compilers? That the guarantee doesn't exist in C? I think we all agree that volatile alone can't solve the problem, because it affects only compilers, not hardware-based instruction reorderings. Scott .