Hacker News new | ask | show | jobs
by shinazueli 1227 days 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

1 comments

I meant inserting barriers (read fence/write fence etc) explicitly. Thanks for the link, very interesting.
Yep, we have `fence` for runtime+compile time barriers, and `compiler_fence` for compile time barriers. They take the same Ordering enum as atomics.