8 points · by signa11 · 2mo ago · 3 comments
Note that I don't recommend spinlock for most cases, only when there is a 1:1 mapping between threads and phsycal CPU cores, and only after measuring
Optimizing a Spin-Lock | David Álvarez Rosa
A spin-lock is a lock that never sleeps. Instead of yielding to the scheduler, the thread stays on the CPU and spins. No syscalls. No context switches. In this …
David Álvarez Rosa