TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Spinlocks Considered Harmful (2020)

2 pointsby f_devdover 1 year ago

1 comment

pipo234over 1 year ago
I guess it comes down to the misconception mentioned in the follow-up article:<p>&gt; For short critical sections, spinlocks perform better<p>While (system) mutexes have some overhead, the userland to OS overhead typically becomes <i>evident</i> only when benchmarking code that guards small critical sections.<p>The knee jerk reaction is then: let&#x27;s stay in userland and use a simple spinlock and move on. The critical section is so small that it&#x27;s actually hard to benchmark and show the alleged improvement. Which it turns out often isn&#x27;t an improvement at all, just a premature optimization.