Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Not sure if you're agreeing with me or contradicting me? Isn't that what I said?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: