4 ms·
Isn't this something Rust std lib api or perhaps LLVM backend should take care of ?
by truth_seeker 6y ago
Isn't this something Rust std lib api or perhaps LLVM backend should take care of ?
- secondcoming 6y agoThe problem is that there's likely to be a fair amount of logically broken 3rd party code out there because x86's memory model semantics doesn't reveal the issues. The compiler can't help here, it'll just do what the developer told it to do. It's a whole new 'it works on my machine' issue (for some people).
- devit 6y agoIt does as long as the programmer uses it properly (i.e. you don't use atomics weaker than SeqCst or unsafe code with shared + mutable accesses unless you have proven that it's correct).
- monocasa 6y agoSee how the functions are all unsafe? The primitives given by the Rust standard library actually do handle this; the author is simply going off the beaten path to illustrate one of the aspects those primitives need to paper over for you.