read/write volatile
read/write volatile
Posted Jan 10, 2026 20:13 UTC (Sat) by comex (subscriber, #71521)In reply to: read/write volatile by plugwash
Parent article: READ_ONCE(), WRITE_ONCE(), but not for Rust
That’s correct, but not actually applicable to Rust, because Rust doesn’t allow atomics to be implemented with a global lock, unlike C++ and C. Instead, on targets that don’t natively support atomics, Rust just makes the atomic APIs unavailable. It’s one of those tradeoffs where Rust is willing to accept slightly less portability in exchange for a nicer programming model.
