Comment on Twenty years of ValgrindparentComments−njs123454yEven rust's memory model has places where it can't do what C++ can. (you can't use atomic to write data from two different threads at the same time)Perhaps not in safe Rust, but can you provide an example of something Rust can't do that C++ can? It has the same memory model as C++20: https://doc.rust-lang.org/nomicon/atomics.html−seoaeu4yYou totally can in safe rust: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU64.h...−njs123454yThe atomics themselves sure, but I guess often they'll be used as a barrier to protect an UnsafeCell or something, like in the implementation of Lazy<T>: https://docs.rs/lazy-init/0.5.0/src/lazy_init/lib.rs.html#85
Comments
Perhaps not in safe Rust, but can you provide an example of something Rust can't do that C++ can? It has the same memory model as C++20: https://doc.rust-lang.org/nomicon/atomics.html
You totally can in safe rust: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU64.h...
The atomics themselves sure, but I guess often they'll be used as a barrier to protect an UnsafeCell or something, like in the implementation of Lazy<T>: https://docs.rs/lazy-init/0.5.0/src/lazy_init/lib.rs.html#85