Subj : Re: volatile or mutex To : comp.programming.threads From : Alexander Terekhov Date : Thu May 12 2005 04:55 am "Scott McPhillips [MVP]" wrote: [...] > volatile has nothing to do with synchronization. It only assures that > the compiler will actually read the variable's memory when you tell it to. Apart from mutable locals affected with respect to setjmp/longjmp() and static sig_atomic_t mess, with respect to objects with standard C/C++ storage duration, volatile has no meaning whatsoever. Abstract C/C++ machine defines neither "read" nor "variable's memory" (apart from accesses to volatile stuff residing outside and thus "observable" just like standard I/O -- both constitute "observable behavior" ). Volatiles are brain-dead (including threads relevant Java & .Net volatile beasts). As for better abstractions... just wait for C++0X (09 hopefully). Well, that's apart from brand new TR1's and for memory mapped registers and alike stuff under (implied) SC for the outer world, so to speak). regards, alexander. .