For Rust, I highly recommend this book https://marabos.nl/atomics/

This is such a great book, especially the section on operating system primitives, which made the book wider in scope and more practical. After all, you're probably not building exotic data structures by hand in memory without also needing high performance IO.

It's been a hobby of mine to collect concurrency examples from books and blog posts and simulating them in Temper, my Rust memory model simulator. As far as I know, it's the largest Rust/C++11 memory model test suite on the internet (but I'm happy to be corrected).

This is the file for Rust Atomics and Locks:

https://github.com/reitzensteinm/temper/blob/main/memlog/tes...

I didn't find any bugs in the examples, but with how good the book was, I didn't expect to :)

The Williams book for C++ contains many of the same ideas (Rust's memory model is a copy/paste from C++11 without the now deprecated Consume) and I can highly recommend that too.

absolutely ! This book is useful for even non rust developers I think

Yes. This is how I learned the atomics and memory ordering. It's so much fun to read, and super interesting.

Highly recommend!