4 ms·
I've also had some trouble reading(and probably really understanding) the term "lock free algorithms", since things like CAS are always mentioned and a CAS inst
by bogomipz 10y ago
I've also had some trouble reading(and probably really understanding) the term "lock free algorithms", since things like CAS are always mentioned and a CAS instruction locks the memory bus like any memory access.
Isn't it more like "mutex minimization" since you are trying to limit the critical section to a single a single atomic instruction(as opposed to more than one)?
- gpderetta 10y ago>CAS instruction locks the memory bus like any memory access. FYI, this hasn't been the case in at least 20 years, on any of the major architectures. Cache coherency guarantees a single writer for any cache line aligned chunk of memory without any sort of bus lock.
- bogomipz 10y agoSure, but even with MESI a CAS translates into an exclusive lock on the cache line by a single core no? I probably could have articulated my original question better, sorry.
- gpderetta 10y agoI guess you could call holding a cacheline in the exclusive state the same as holding a lock. The difference, I think, is that there's an hard upper bound on response time on serving any remote request for sharing.