ABA Problem

In a lock-free stack using compare-and-swap (CAS) to pop elements, what is the ABA problem?

A

A thread starves because other threads continuously succeed at CAS before it can retry

B

Two threads attempt to push the same value simultaneously, causing duplication

C

A thread reads pointer A, another thread pops A then pushes new node B then pushes A back, and the first thread's CAS succeeds despite the stack having changed underneath it

D

The CAS instruction fails spuriously due to cache line contention between cores