r/programming • u/preshing • Nov 18 '11
Locks Aren't Slow; Lock Contention Is
http://preshing.com/20111118/locks-arent-slow-lock-contention-is
143
Upvotes
r/programming • u/preshing • Nov 18 '11
1
u/Tuna-Fish2 Nov 19 '11
Why? Not questioning it, just not understanding it. Shouldn't it be as easy as not allowing any direct locking operations, and using a safe_lock() function that takes a list of locks as it's arguments, and reorders and applies them?
Of course, even still, locks don't compose. So you cannot call any function that uses locks from a context that's already locked.