The ABA problem can arise when working with multiple threads. It is most commonly seen in lock-free data structures (e.g., a linked list).
Consider that there are two threads/processes, T1 and T2, that have shared access to a linked list.
Here’s how the ABA problem could occur:
The problem here is that T1 does not know that the list has been altered by T2. Once T1 resumes, it finds A and deletes it, unaware that B does not exist anymore.
T1 then points the head of the list to the address of B, which contains NULL. As a result, the remaining list is lost.
Free Resources