Re:What every systems programmer should know about lockless ...
by jeff571 on Thursday November 02, 2017 @09:53AM
(#15610372)
The lock could still be faster. atomic ops are more expensive than regular opcodes even when there is zero contention. On x86, a lock requires only a single atomic opcode and can be released with a normal write (because of TSO). Since it's uncontended it won't spin at all. Therefore, any alternative lock-free algorithm that uses more than a single atomic op is actually more expensive.
[ Parent
| on HN ]
There are no comments on this comment yet.