3 ms·
It has Atomics that use the same memory constraint model (Relaxed, SeqCst, etc), if that’s what you meant. You can indeed create data races with them, but only
by shinazueli 4y ago
It has Atomics that use the same memory constraint model (Relaxed, SeqCst, etc), if that’s what you meant.
You can indeed create data races with them, but only in combination with unsafe code.
https://doc.rust-lang.org/nomicon/races.html https://doc.rust-lang.org/nomicon/races.html
- anonymousDan 4y agoI meant inserting barriers (read fence/write fence etc) explicitly. Thanks for the link, very interesting.
- jamesmunns 4y agoYep, we have `fence` for runtime+compile time barriers, and `compiler_fence` for compile time barriers. They take the same Ordering enum as atomics.