Subj : Re: Memory visibility and MS Interlocked instructions To : comp.programming.threads From : Torsten Robitzki Date : Mon Aug 29 2005 10:30 pm Hi Alexander, Alexander Terekhov wrote: > Torsten Robitzki wrote: > [...] > >>In this case it will be sufficient to make sure that the compiler won't >>reorder the reads on the reading side, which might be given as one of >>the variables involed beeing volatile qualified. ^^^^^^ > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > What makes you think so? Because the cited mircosoft documentation showed some snipped of code they claimed to work. Only one of the involved variables where volatile qualified. It might be that microsoft compilers don't reorder _any_ access around a volatile variable. The OP asked if in general a reader thread have to take any special actions, to read a sequence of changes in the same order as written in a releaxed memory model. I've constructed a case where it will not be nesseary, and maybe Alpha migth be such a case. regards Torsten .