Why Lock-free Programming is Hard and How I Found a Bug in Lecture Slide

How I Found a Subtle Bug Hiding in a CMU 15-418/618 Lecture Slide Lock-free programming has this magical aura around it. If you’ve ever heard of lock-free programming, you’ve probably seen those neat little Compare-And-Swap (CAS) loops that seem to solve everything. I found a bug in a CAS loop that had been sitting quietly in CMU’s 15-418 Parallel Computer Architecture lecture slide for years. The “Simple” Example Here’s what the example in lecture slide looked like: ...

October 11, 2025 · 6 min · 1196 words · Li Cao