An introduction to lockless algorithms
An introduction to lockless algorithms
Posted Feb 20, 2021 8:58 UTC (Sat) by kurogane (guest, #83248)In reply to: An introduction to lockless algorithms by pbonzini
Parent article: An introduction to lockless algorithms
Thanks Paolo. If the processor instructions don't necessarily follow the higher-level language flow shown in the example, then it I get it I believe. Well, could you confim?
The instruction flow in the processor could end up like the below, as the C programmer mentally pictures it?
thread 1 thread 2
-------------------------------- ------------------------
message = &a; ...
...
a.x = 1; ...
(Focusing just on thread 1 as that is the more likely jeopardy-maker.)
I think I finally understand what memory barriers are - temporal ones, not spatial.
