3 ms·
A contested mutex lock / unlock is over L3 cache. Uncontested mutex lock/unlock is just a swap instruction followed (or in "unlock": preceded) by a memory barr
by dragontamer 6y ago
A contested mutex lock / unlock is over L3 cache.
Uncontested mutex lock/unlock is just a swap instruction followed (or in "unlock": preceded) by a memory barrier. The flush pushes data to L3 cache, where it can be shared between multiple cores. (L1 and L2 cache is local to a core).
L3 cache is far closer than main-memory, and roughly 20ns these days.
-------
In "actuality", its more of a MESI message, but in the abstract its your L3 caches communicating with each other and synchronizing.
- chrisseaton 6y agoNot sure if you're agreeing with me or contradicting me? Isn't that what I said?