Subj : Re: double-checked locking in C To : comp.programming.threads From : David Schwartz Date : Fri Jul 08 2005 07:32 pm "Peter Dimov" wrote in message news:dan5la$5qg$1@domitilla.aioe.org... > "As if" means that the compiler can achieve the required observable > behavior > in whatever way it likes. If we assume an implementation where "volatile > access" maps to a load instruction and "volatile write" maps to a store > instruction, "as if" means that the compiler can elide or reorder all > other > memory accesses and optimize out or overlap all nonvolatile objects as > long > as the sequence of loads/stores corresponding to volatile accesses/writes > remains in place. What is "the sequence of loads/stores"? In the CPU instruction stream? On the memory bus? To the cache? You are doing the same thing you said you could not do. How can the C standard specify where the sequence of loads/stores is to be observed? DS .