Previous | Next --- Slide 18 of 39
Back to Lecture Thumbnails
amolakn

I'm not quite sure why this is called "hand-over-hand" locking. Is it just because it's saying that if there's some non-atomic operation you explicitly swap between thread access rather than having a universal lock?

ferozenaina

It is called hand-over-hand as at a given time, thread 0 locks only two units of the data structure instead of locking the entire data structure. This allows other thread 1 to operate on other parts of the data structure.

Thread 0 will give up the previous lock and capture the next lock in a sequence as it progresses. It's also called chained locking as the locks are next to each other as they progress forward.