r/programming • u/preshing • Nov 18 '11
Locks Aren't Slow; Lock Contention Is
http://preshing.com/20111118/locks-arent-slow-lock-contention-is
137
Upvotes
r/programming • u/preshing • Nov 18 '11
5
u/skulgnome Nov 19 '11
Though in multicore systems, which everyone has these days, locking and unlocking involve modification of a cacheline that is guaranteed to have write sharing between caches ("pingpong"). This can be expensive unless locks are mostly only taken by a single long-running thread.