Subj : Re: [.NET] Volatile Fields To : comp.programming.threads From : David Schwartz Date : Fri Sep 16 2005 02:40 pm "Cool Guy" wrote in message news:q6n7xt2m767c.dlg@cool.guy.abc.xyz... > Shouldn't Test.result be declared as volatile aswell? My understanding is > that it should because otherwise the write to it in Thread2 might not be > visible to other threads, since the value may be written to a cache > instead > of to main memory. It does not have to be on this platform because, as the page says: A read of a volatile field is called a volatile read. A volatile read has "acquire semantics"; that is, it is guaranteed to occur prior to any references to memory that occur after it in the instruction sequence. and: A write of a volatile field is called a volatile write. A volatile write has "release semantics"; that is, it is guaranteed to happen after any memory references prior to the write instruction in the instruction sequence. Note that this is .NET specific. DS .