Question: The two operations are: (1) delete the node pointed by p and free up its memory chunk, and (2) reuse the chunk as a new
The two operations are: (1) delete the node pointed by p and free up its memory chunk, and (2) reuse the chunk as a new node having a key value of 10 and insert the new node into the list. Suppose that the new node is inserted by T2 into the list at exactly the same position as the old node was. When T1 continues with acquiring locks and testing its assumptions, it finds that the assumptions are valid, i.e., the node pointed by prev and p are not in a deleted state, and prev->next == p. Thus, T1 deletes the node with a key value of 10, rather than the one it intended to delete. Give three possible solutions to avoid this ABA problem, and list their advantages and disadvantages.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
