HN Hall of Fame Weekly email

An Introduction to Lockless Algorithms

Screenshot of lwn.net captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 3 calendar years, with breakout response in 2 of them.

submissions
5
submitters
4
observed span
2021–2024
peak thread · 69 comments
226 pts
latest 20+ return · 2023-04-24
216 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

One point that's frequently misunderstood about locks is that there's essentially no cost unless the lock is contested. This leads a lot of people to they must go lockless, when a simpler lock-based system would meet their requirements. A lot of systems fit neatly into a paradigm of a single threaded hot path, plus a lot of infrequent peripheral threads that only have a low statistical contention cost. For example let's say you want to process packets off the network…

"Lockless" sounds very positive, and it's tempting to think that everything should be made lockless. However, it's less great than it sounds. Mutexes are very cheap in the uncontended case, and in the contended case they have some nice properties. You should only consider going for a lockless algorithm if you can prove it is better than just using a mutex. Sometimes lockless algorithms are in fact slower than algorithms using locks, as things like atomic compare-and-exchange instructions can have…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
452

reference only — not used in Hall rules or ranking

Total comments
108

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2021-03-04An Introduction to Lockless Algorithmstodsacerdoti30
2021-03-04An Introduction to Lockless AlgorithmsFirst breakout · Best threadsigna1122639
2023-04-08An Introduction to Lockless Algorithmsmuxator30
2023-04-24An Introduction to Lockless AlgorithmsLatest 20+ point returnsigna1121669
2024-12-29An introduction to lockless algorithms in Linuxfanf240