← All projects
Project record1 mention
Originally shared on Hacker News

Learning Lock-Free Data Structures (CAS Me If You Can blog series)

A three-part blog series on learning lock-free data structures. It walks through building a Treiber Stack first in Go and then in C++, diagnosing ABA and use-after-free issues in the C++ implementation, touching on hazard pointers, and finishing with a benchmark comparison between a mutex-based and a lock-free version of the stack. LLMs were used as a teaching aid to explain concepts and handle setup, without generating code.

Last shared
01 / The problem

What it addresses

Learning lock-free data structures is difficult and can otherwise require reading dense and obscure books.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Learning Lock-Free Data Structures (CAS Me If You Can blog series)

    A three-part blog series on learning lock-free data structures. It walks through building a Treiber Stack first in Go and then in C++, diagnosing ABA and use-after-free issues in the C++ implementation, touching on hazard pointers, and finishing with a benchmark comparison between a mutex-based and a lock-free version of the stack. LLMs were used as a teaching aid to explain concepts and handle setup, without generating code.

    Problem: Learning lock-free data structures is difficult and can otherwise require reading dense and obscure books.

    Posted by @manish_gill · Original source ↗

    Source text · @manish_gill · · Source ↗

    Learning Lock-Free Data Structures: - https://parallelthoughts.xyz/2026/03/cas-me-if-you-can-part-1/ - https://parallelthoughts.xyz/2026/06/cas-me-if-you-can-part-2/ - https://parallelthoughts.xyz/2026/07/cas-me-if-you-can-part-3/ Mostly me exploring how to build a Treiber Stack (first in Go, then in C++) -> Figuring out ABA and Use-After-Free in the C++ implementation, and then touching a bit of Hazard Pointers, and ending with a benchmark comparison b/w a mutex and a lock-free version of the stack.