Subj : Re: [.NET] Volatile Fields [correction] To : comp.programming.threads From : Alexander Terekhov Date : Mon Sep 19 2005 09:40 pm Cool Guy wrote: > > David Hopwood wrote: > > > The write to Y is not performed as a single atomic event; it has to be modelled > > as two events: "Y = 1 is performed with respect to processor 2" and "Y = 1 is > > performed with respect to processor 3". So it can happen that processor 2 sees > > Y == 1 before writing Z = 1, but processor 3 does not see Y == 1 until after > > it sees Z == 1. > > > > So it's impossible to make such code thread-safe, then? Illusion of remote write atomicity can be achieved by turning all reads into dummy RMWs. The problem is that even Intel's own architects don't seem to know how to do a dummy RMW that would be guaranteed not to optimize out a write part (so to speak) of a dummy RMW on their existing and future PC (x86/WB) processors. regards, alexander. .