> If you have a queue with multiple feeders/eaters the pointer word is not
> enough for integrity. You need a monotonic increasing sequence number which
> you can play with CDS.

The ABA problem does not occur if a LIFO stack is being removed
all at once by a reading task which will then own it, so there
is no need for a counter in that case.

It occurs when an entry is being removed from a stack or queue
by changing the top of stack to the address of the next entry.
In that case, a counter with CDS is needed to ensure that the
entry has not been removed, processed and reused with a
different "next" pointer before the compare and swap.

Jonathan Scott, HLASM
IBM Hursley, UK

Reply via email to