Tuesday, March 03, 2009

Lock is NOT the superset of mfence

From a recent post of Dmitriy at com.programming.threads. I keep this here as a memo.

I was always thinking that LOCK is a kind of superset of MFENCE. It turns out that this is architecture dependent:

------------------------------
For the P6 family processors, locked operations serialize all outstanding load and store operations (that is, wait for them to complete). This rule is also true for the Pentium 4 and Intel Xeon processors, with one exception. Load operations that reference weakly ordered memory types (such as the WC memory type) may not be
serialized.
--------------------------------
Dmitriy V'jukov


Thanks, Dmitriy!

0 comments: