HN Hall of Fame Weekly email

Ways to break your systems code using volatile (2010)

blog.regehr.org Books & learning Tutorials & guides Software engineering Candidate
Screenshot of blog.regehr.org captured 2026-07-20
Page preview · captured 2026-07-20

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

submissions
6
submitters
6
observed span
2010–2023
peak thread · 73 comments
132 pts
latest 20+ return · 2023-10-05
124 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

This should say 2010. I believe much of it is out of date, as C11 does have a memory model, and does provide both atomics and barriers. Many, if not most, uses of volatile should probably be replaced by atomics. https://en.cppreference.com/w/c/atomic

There are gaping omissions in this article. There is a need for volatile in portable C programming, in two circumstances: 1. When an asynchronous signal handler modifies a variable that is inspected by the interrupted mainline code (e.g. to set a flag indicating that the signal went off), that variable must be of type "volatile sig_atomic_t". (The article points to some outside discussion by Hans Boehm about this in relation to Unix, but it's not just for Unix; it's in…

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
290

reference only — not used in Hall rules or ranking

Total comments
136

reference only — not used in Hall rules or ranking

Every submission