Hacker News new | ask | show | jobs
by mickronome 2923 days ago
There shouldn't really be any outside of the kernel, and preferably none inside.
1 comments

On the contrary: Spinlocks are faster than any other lock. In fact, they're faster than many atomics-based lock-free datastructures (!!!) in many cases.

https://www.youtube.com/watch?v=9hJkWwHDDxs

Atomics-based lock-free data-structures scale beyond 40+ core counts. But note that x86's "lock" instruction is fundamental to the system. x86 doesn't have relaxed atomics or barriers under most circumstances. As such, the spinlock best represents what the x86 instruction set offers.