Subj : Re: [.NET] Volatile Fields To : comp.programming.threads From : Cool Guy Date : Sat Sep 17 2005 01:31 pm David Hopwood wrote: > It doesn't need to be. Because 'finished' is volatile, the assignment > "finished = true;" causes previous writes by Thread2 (whether or not they > are to volatile variables) to be "performed" before the write to 'finished'. > This is what the page means by 'A volatile write has "release semantics"'. But couldn't *result* be written to a cache instead of to main memory? > In addition, the access to 'finished' in "if (finished) ..." guarantees > that writes performed before 'finished' became true are visible to the > Main thread. This is what the page means by 'A volatile read has "acquire > semantics"'. But couldn't *result* be read from a cache instead of from main memory? .