r/programming • u/david-alvarez-rosa • Sep 09 '26
Optimizing a Spin-Lock
https://david.alvarezrosa.com/posts/optimizing-a-spin-lock/
183
Upvotes
r/programming • u/david-alvarez-rosa • Sep 09 '26
View all comments
Show parent comment
1
u/ReDucTor Sep 10 '26
I have seen alot of performance captures where spin locks (and spinning in general) have made things exceeding bad especially when they yield to other threads.
Unfortunately people still believe they know best and think a spin lock will be the better option without having properly testing it in the real world just some isolated microbenchmark. This is especially bad when you dont fully control the environment such as a customers machine.