An introduction to lockless algorithms
An introduction to lockless algorithms
Posted Mar 20, 2021 19:18 UTC (Sat) by guzh (subscriber, #140551)In reply to: An introduction to lockless algorithms by pbonzini
Parent article: An introduction to lockless algorithms
Can we say that, in this case, the "happens before" effect is just a result of the fact that reordering is disallowed?
And only if the load *actually* happens after the store, we can say "a.x = 1" happens before "datum->x".
(If thread 2 runs really fast and completes before thead 1 starts, it sure won't get the proper value in x.)
And only if the load *actually* happens after the store, we can say "a.x = 1" happens before "datum->x".
(If thread 2 runs really fast and completes before thead 1 starts, it sure won't get the proper value in x.)