An introduction to lockless algorithms
An introduction to lockless algorithms
Posted Feb 21, 2021 19:13 UTC (Sun) by khim (subscriber, #9252)In reply to: An introduction to lockless algorithms by pbonzini
Parent article: An introduction to lockless algorithms
> On x86 that reordering cannot happen, on ARM and PowerPC it might.
Tiny correction: on x86 it can and will happen. You need memory barriers there, too.
After reading the aforementioned article I was confused for some time: memory barriers arrived on x86 with SSE… yet SMP was supported for more than decade by that time! Some investigation showed that any instruction with lock prefix acts as a memory barrier on x86. But if there are not memory barriers at all… yes, it does happen on x86, too.
