Subj : Re: Memory visibility and MS Interlocked instructions To : comp.programming.threads From : Torsten Robitzki Date : Mon Aug 29 2005 11:06 pm Alexander Terekhov wrote: > Torsten Robitzki wrote: > [...] >=20 >>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. >=20 >=20 > Well, judging from=20 >=20 > http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/vcla= ng/html/vclrf_ReadWriteBarrier.asp >=20 > I gather that nobody really knows what they do. >=20 Wow, very confusing example, on one side they use volatile to make sure=20 that a change to WaitF will be visible one the other side the very=20 important call to _ReadWriteBarrier() is used to make the change to the=20 "G" vissible. To cite David Schwartz: "It's not important what works but what is=20 garantied to work!" (Sinngem=E4=DF). regards Torsten .