Subj : Re: [.NET] Volatile Fields To : comp.programming.threads From : Cool Guy Date : Sun Sep 18 2005 04:43 pm David Schwartz wrote: > There are three things that cause problems for multi-threaded programs > on typical modern SMP machines: > > 1) Instruction re-ordering. This is where the compiler or the processor > internally performs instructions in a different order from that in the > high-level code. So, with this issue, the reads/writes - when they're made - *will* be made in a way that other threads can see them -- but the only problem is that they might happen too late or too early, right? > 2) Posted writes. This is where the CPU does not output a write to its > cache immediately but instead puts it in a temporary holding place. (Not the > L2 cache, but a posted write buffer.) > > 3) Speculative fetches. This is where the CPU reads data before it needs > it and keeps the data for a later instruction. So I assume memory barriers solve all three problems? .