Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One piece of friction that hurts here is that the C++/Rust and ARM memory models aren't the same, and the consequences of this are unintuitive - compilers and CPUs can both screw with execution ordering.

People who write in C++ should technically _only_ be concerned with the C++ memory model, but x86 has let them be very lax and undisciplined with std::memory_order_relaxed. ARM has some alluring constructs that don't quite fit with the C++ model, which can tempt you to mix and match memory models for performance. All of this means trouble with atomics.



ARMv8 basically exactly mirrors the C++ memory model without any explicit memory orderings (the default on atomics being sequentially consistent).


It also added load acquires and store releases to map to the corresponding very common (as they are fast on x86) C++ primitives.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: