7 ms·
As I understand it, it's the other way around: for x86 (which is TSO) the fence doesn't really matter because the "normal" load is already slowed down, but for
by Joker_vD 7mo ago
As I understand it, it's the other way around: for x86 (which is TSO) the fence doesn't really matter because the "normal" load is already slowed down, but for ARM it does matter quite a bit, see e.g. [0] (admittedly old blog post) slightly lower on the page. But perhaps we did get to the point where even ARM CPUs and surrounding memory is already performant enough so that spurious fences aren't as noticeable.
[0] https://preshing.com/20140709/the-purpose-of-memory_order_consume-in-cpp11/#the-value-of-consume-semantics https://preshing.com/20140709/the-purpose-of-memory_order_co...
- gpderetta 7mo agoarm64 added a load acquire instruction which I think it is fast enough on actual hardware that might not be worth bothering with consume. If it isn't, then load-relaxed plus atomic_signal_fence might be your best bet. Good luck!