Subj : Re: [.NET] Volatile Fields [correction] To : comp.programming.threads From : David Schwartz Date : Mon Sep 19 2005 12:36 pm "Cool Guy" wrote in message news:1cgq3c5ccqz6r.dlg@cool.guy.abc.xyz... > 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? With memory barriers, yeah. Just use mutexes or other *appropriate* synchronization mechanisms. ;) DS .