r/programming • • Sep 09 '26

Optimizing a Spin-Lock

https://david.alvarezrosa.com/posts/optimizing-a-spin-lock/
183 Upvotes

32 comments sorted by

View all comments

Show parent comment

7

u/david-alvarez-rosa Sep 09 '26

The server used for benchmarking is tuned (no SMT) https://david.alvarezrosa.com/posts/tuning-a-server-for-benchmarking/

Fair enough that microbencharmking is always unrealistic, but in use cases with fully controlled server, and a 1:1 mapping between threads (pinnned) and physical cores, spinlocks are typically useful