Subj : Re: Memory Barriers, Compiler Optimizations, etc. To : comp.programming.threads From : Alexander Terekhov Date : Mon Feb 07 2005 11:17 am "Neill Clift [MSFT]" wrote: > > "Alexander Terekhov" wrote in message > news:420506AC.4D92C384@web.de... > > > > Same basis as with respect to preservation of sequence of std IO > > calls to dev/null (with destination known in advance so to speak). > > The thing is that C/C++ volatile abuse isn't really "observable > > behavior" under single-threaded C/C++ standard(s), you know. > > > > In section 6.5.3 of the ANSI C standard as a footnote it says: > > 'A volatile declaration may be used to describe an object > corresponding to a memory-mapped input/output port...' Yes. Note that I said "volatile abuse". Simply put, when you write something like volatile int i = 1; int main() { return --i; } you better be prepared that smart compiler can tranform it to int main() { } regards, alexander. .