Re:A lock-free, concurrent, generic queue in 32 bits
by gpderetta on Sunday May 15, 2022 @06:57AM
(#31386741)
Because the queue grows only in one direction and it is consumed in the other direction, reading a stale value from the other side is still safe, so two-word atomicity is not needed.
In fact the other side value is normally cached in a local memory location so to amortize the cost of roundtrips over multiple reads and writes.
In fact the other side value is normally cached in a local memory location so to amortize the cost of roundtrips over multiple reads and writes.