News for hackers. Stuff that matters.
Re:Notes on a Smaller Rust by dbaupp on Thursday July 18, 2019 @05:39PM (#20474179)
They have to go via the atomic types or it is undefined behaviour. One can use a very weak ordering (such as Relaxed) to require little or no "physical" synchronisation by the CPU. Like C++, Rust atomics offer a range of levels of synchronisation, weaker than sequential consistency.

A platform like the JVM disguises this because every read and write (even without 'volatile') use minimal synchronisation to avoid the worst aspects of the danger here. This ensures that programs that do it wrong (e.g. forget a 'volatile') are "only" incorrect, but not unsafe.

Re:Notes on a Smaller Rust by tomp on Friday July 19, 2019 @05:42AM (#20477264)
Ah, you're right, weaker ordering takes care of a lot of these issues! Good point, thanks!