| I guess there must be at least one book about the Java Memory Model, which is very different but fascinating? I don't know of any specific books to recommend. For many languages there is nothing resembling this, they tend to not get into the details Mara covers, if you get a mutex and maybe atomic arithmetic then they're done. If you wondered about C or C++, this book is the same content as for those languages but with Rust's syntax. The discrepancy between Rust's memory model and the memory model adopted in C++ 11 and subsequently C is mostly about a feature that's not available in your C or C++ compiler and (which is why Rust doesn't have it) probably won't ever be. C++ x.store(r1, std::memory_order_relaxed); is literally the same thing as Rust x.store(r1, std::sync::atomic::Ordering::Relaxed); The biggest syntax difference is that C++ x.store(r1) compiles, and in Rust it doesn't. But, chances are after reading Mara's book you will think it's weird not to specify the Ordering needed and never use this uh, convenience. |
Java's happens-before memory model is similar to C++'s.
I'll prob get this book, if only for the memory model chapter.