Previous | Next --- Slide 32 of 37
Back to Lecture Thumbnails

The ABA Problem doesn't occur here since we're inserting elements in sorted order.


@woohoo I don't see any explicit order here. What do you mean by sorted order? Also ABA problem mentioned earlier is in the case of stack, and now we are only talking about insertion in linked list.


The ABA problem is not specific to a stack. It can occur whenever a CAS is used to determine whether or not other data structure operations have occurred between the start and end of an operation by the calling thread. In the case of the stack, the CAS was used to check where another thread had manipulated the stack in the time between the calling thread started a push/pop and finished it.