Remix.run Logo
▲ Calavar 2 hours ago

C++ committee members (mainly Boehm, but also Stroutstrup) also deserve a lot of credit for giving us a well specified memory model for concurrency outside of functional languages. Rust basically copy/pasted the C++11 memory model wholesale. Rust's fearless concurrency owes a lot to standing on the shoulders of giants.

▲tialaramex 36 minutes ago | parent | next [-]

I don't think fearless concurrency is strongly related to the atomic memory ordering model.

C++ 11 wants to model two non-trivial orderings, Acquire-Release and Consume-Release, but only Acquire-Release is actually usable. So yes, C and Rust both also choose to offer Acquire-Release ordering like C++ but it's also clear that the universe of possibilities is actually smaller than WG21 realised when C++ 11 was developed.

If on your first random stab you guess 65537 is prime, you're correct and you might foolishly assume all those Fermat Numbers are prime and then try say, 4294967297. Nope, that's divisible by 641 for some reason. There are only Five of these Fermat Primes so far as we know, they weren't common after all.

▲cogman10 2 hours ago | parent | prev | next [-]

C++11 borrowed heavily from the Java memory model that came before it.

It's basically everyone learning from everyone else on what works and what doesn't work.

▲colanderman 30 minutes ago | parent | prev [-]

Nit: Rust currently adheres to C++20 memory model. At least one notable difference from earlier versions which tripped me up recently is that release sequences aren't extended by further writes.