Memory ordering – happens-before and synchronizes-with

Each CPU architecture treats memory ordering—the dependency relationships between loads and stores—differently. We discussed this in detail in Chapter 1, Preliminaries – Machine Architecture and Getting Started with Rust. Suffice it to say here in summary, x86 is a strongly-ordered architecture; stores by some thread will be seen by all other threads in the order they were performed. ARM, meanwhile, is a weakly-ordered architecture with data-dependency; loads and stores may be re-ordered in any fashion excepting those that would violate the behavior of a single, isolated thread, and, if a load depends on the results of a previous load, you are guaranteed that the previous load will occur ...

Get Hands-On Concurrency with Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.