Beingessner: Rust's Unsafe Pointer Types Need An Overhaul
Beingessner: Rust's Unsafe Pointer Types Need An Overhaul
Posted Mar 22, 2022 11:29 UTC (Tue) by tialaramex (subscriber, #21167)In reply to: Beingessner: Rust's Unsafe Pointer Types Need An Overhaul by jlombera
Parent article: Beingessner: Rust's Unsafe Pointer Types Need An Overhaul
You can take a look at a toy example with Godbolt, and see for yourself what the compiler actually tells your CPU to do, on x86 (and x86-64) you get Acquire/Release semantics (but not full consistency) "for free" (in fact everybody is paying for these semantics, all the time on this platform so it's only "free" the same way the ice is "free" with a $5 coke in a restaurant) but on other platforms if you don't see the CPU being told to do this work it's not doing the work. Maybe you get away with it, and maybe you don't. You are gambling every time.
