Previous | Next --- Slide 11 of 30
Back to Lecture Thumbnails
rokhinip

There shouldn't be a need for T1 to hold onto all 3 locks here right? It should be able to let go of the lock for 3 and then grab 10. This is cause we have the lock for 5 and so we know that 10 could not be deleted by any other thread.

kayvonf

To delete 10 you need locks for 5 (prevNode) and 10 (curNode).

If you have the lock for 10, you know:

  • No other thread can insert after 10, since inserting requires a previous pointer.
  • No other thread can be deleting 18, since deleting requires a previous pointer.