Rust Atomics and LocksMara Bos

Rust Atomics and Locks

by Mara Bos · first published 2022

26mentions
18recommended by
20HN commenters
2023–2026first – last mentioned

90% recommend10% neutral

Why HN recommends it

Clear, detailed explanation of low-level concurrency, atomics, and memory ordering; useful even for non-Rust programmers, and suits readers who already know basic Rust and want deeper systems-level understanding.

Summarised by Claude from recommending comments

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

80 2007: 0 mentions2008: 0 mentions2009: 0 mentions2010: 0 mentions2011: 0 mentions2012: 0 mentions2013: 0 mentions2014: 0 mentions2015: 0 mentions2016: 0 mentions2017: 0 mentions2018: 0 mentions2019: 0 mentions2020: 0 mentions2021: 0 mentions2022: 0 mentions2023: 6 mentions2024: 6 mentions2025: 8 mentions2026: 2 mentions200720172026

What Hacker News says

  • burntsushi · Mar 9, 2023 · Recommends

    …benefit of (IMO) being more accessible by describing borrows in terms of the most common effect: to mutate or not. I don't know which choice would have been the right one, but I am at peace with it. "Rust Atomics and Locks" by Mara Bos has a great discussion of these points toward the beginning of her book, and specifically grounds the choice of which terminology to use in concrete and practical terms, which I really appreciated.

    on “Getting Past “Ampersand-Driven Development” in Rust” ↗
  • comonoid · Aug 18, 2023 · Recommends

    1. Program = Proof by Samuel Mimram Math foundation of programming. Church–Rosser theorem, Curry–Howard correspondence, intuitionistic logic, theorem proving with dependent types, etc. 2. Rust Atomics and Locks: Low-Level Concurrency in Practice by Mara Bos Great introduction even for non-Rust programmers. 3. Statistical Consequences of Fat Tails by N. Taleb et al. I've just started to read it, but looks…

    on “Ask HN: Any interesting books you have read lately?” ↗
  • weinzierl · Nov 28, 2023 · Recommends

    This is a very approachable, yet detailed, introduction to a difficult topic. I wish I had it when I first got into this. Another good resource for me was Mara Bos' book "Rust Atomics and Locks". It is primarily a Rust book , but I found the concise and reduced to the essentials explanations of memory ordering really helpful.

    on “C++ Memory Model: Migrating from x86 to ARM” ↗
  • afdbcreid · Aug 26, 2026 · Recommends

    Rust Atomics and Locks by Mara Bors (https://mara.nl/atomics/) is a very good book and available for free online. It does require knowing Rust at least in a basic level, but it explains things very well.

    on “Memory Ordering in CPUs” ↗
  • estebank · Jan 6, 2023 · Recommends

    The foreword by Paul E. McKenney makes a great case to read this book even if you don't care about Rust at all: > Which brings us to another group of potential readers, the Rust skeptics. While I do believe that most Rust skeptics are doing the community a valuable service by pointing out opportunities for improvement, all but the most Rust-savvy of skeptics would benefit from reading this book.

    on “Rust Atomics and Locks: Low-Level Concurrency in Practice” ↗
  • neandrake · Apr 24, 2023 · Recommends

    Thanks for linking all these references! I’m also new to a lot of these topics but recently read Rust Atomics and Locks which has helped my understanding quite a bit - at least keeping me above water reading all the discussion in this post. The examples are in Rust but the concepts are at the kernel/cpu level and apply beyond the language. I recommend it. https://marabos.nl/atomics/

    on “An Introduction to Lockless Algorithms” ↗
  • zozbot234 · Jan 12, 2024 · Recommends

    The best exposition of advanced concurrency I know of is Mara Bos' Rust Atomics and Locks - https://marabos.nl/atomics/ also available as a physical book. Don't let the "Rust" reference put you off, the book is relevant to any low-level programming language. (If you're interested in concurrency in a Linux context as seen from a broader systems point of view, you might like Paul McKeneny's 'Is Pa

    on “Atomics and Concurrency” ↗
  • jamesmunns · Feb 29, 2024 · Recommends

    Back then, there weren't as good references for explaining atomic ordering, and the blog post had gotten long enough. Mentioning SeqCst was a bit of a cop out, though both Andrea and I didn't end up using SeqCst past the inital impl anyway. Today I would have just linked to https://marabos.nl/atomics/, Mara does a much better job of explaining atomics than I could have then or now.

    on “A lock-free ring-buffer with contiguous reservations (2019)” ↗
  • jamesmunns · Feb 29, 2024 · Recommends

    Back when this post was written, I would have agreed with you. But Mara's book makes a good case for this: https://marabos.nl/atomics/memory-ordering.html#common-misco... More importantly, when reading code, SeqCst basically tells the reader: "this operation depends on the total order of every single SeqCst operation in the program," which is an incredibly far-reaching claim. The same code

    on “A lock-free ring-buffer with contiguous reservations (2019)” ↗
  • newpavlov · May 11, 2024 · Recommends

    For a more in-depth understanding, I recommend reading "Rust Atomics and Locks": https://marabos.nl/atomics/ It uses Rust for examples, but it more or less applicable to C/C++ as well.

    on “Making Sense of Acquire-Release Semantics” ↗
  • zozbot234 · Oct 2, 2024 · Recommends

    > Not too sure what the basic rules are and I'm not able to find any list of such rules. You may want to consider https://marabos.nl/atomics/ for an approachable overview that's still quite rigorous.

    on “The Fastest Mutexes” ↗
  • sshine · Nov 30, 2024 · Recommends

    …- The Rustonomicon: https://doc.rust-lang.org/nightly/nomicon/ - Rust Design Patterns: https://rust-unofficial.github.io/patterns/ - Effective Rust: https://www.lurklurk.org/effective-rust/ - Rust Atomics and Locks: https://marabos.nl/atomics/foreword.html - The Little Book of Rust Macros: https://danielkeep.github.io/tlborm/book/index.html - Burn: Deep Learning Framework: https://burn.dev/burn-book/ - API…

    on “Rust: Tools (early access edition)” ↗
  • tialaramex · Dec 14, 2024 · Recommends

    Several other people have commiserated, so rather than do the same maybe we can help. Are you quite sure you understand the atomic primitives you're working with? Mara's book https://marabos.nl/atomics/ is pretty good, it's written in Rust but like, if you thought you needed a Memory Ordering that doesn't cover you're boned because your tools don't support that order (and probably in an appendix

    on “What every systems programmer should know about concurrency (2020) [pdf]” ↗
  • kshri24 · Mar 2, 2025 · Recommends

    In this order: 1. The Rust Book (Free) - https://doc.rust-lang.org/book/ 2. Rust by Example (Free) - https://doc.rust-lang.org/rust-by-example/ 3. Rust Atomics and Locks - https://marabos.nl/atomics/ 4. Rust in Action - https://www.rustinaction.com/ 5. Rust for Rustaceans - https://rust-for-rustaceans.com/ Also Jon Gjengset's channel is immensely valuable: https://www.youtube.com/c/JonGjengs

    on “Effective Rust (2024)” ↗
  • kshri24 · Mar 2, 2025 · Recommends

    You are right about it not being a beginner friendly book. Hence why I placed it lower in the order of books to study. Yeah Rust atomics and locks is essential if you truly want to understand low-level concurrency. But you might have to also refer to the C++ std::atomics reference [1] to get a complete idea. It took me a while to grasp those concepts.…

    on “Effective Rust (2024)” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help