Re:What's up with this new memory_order_consume memory order?
by jlokier on Wednesday May 24, 2023 @09:09AM
(#36057495)
If Consume is discouraged, what should you use instead for the read side of RCU style algorithms?
Acquire is too heavy, and Relaxed is too relaxed, even if it often works on non-Alpha CPUs in practice, it assumes the compiler doesn't get too clever with speculative prefetch and reuse optimisations.
Do we really still need to use Linux's compiler-specific `rcu_dereference` in performant code just because Consume isn't implemented?
Acquire is too heavy, and Relaxed is too relaxed, even if it often works on non-Alpha CPUs in practice, it assumes the compiler doesn't get too clever with speculative prefetch and reuse optimisations.
Do we really still need to use Linux's compiler-specific `rcu_dereference` in performant code just because Consume isn't implemented?