Previous | Next --- Slide 45 of 66
Back to Lecture Thumbnails
tp

One potential issue that we briefly discussed in class was with deadlocking. For example, if you tried to implement the same kind of fine grained locking that we used on the singly linked list on a doubly linked list, then you could run into a deadlock if two threads tried to traverse the list from opposite directions and ran into each other in the middle. To get around this, you would have to engineer a more sophisticated locking scheme that would eliminate one of the four conditions that cause deadlock: whether that be adding preemption or getting rid of mutual exclusion, hold and wait, or circular waiting somehow.

chii

In terms of dependencies, we need a lock on every data structure element that has a dependency on the item we may potentially modify. E.g. on the linked list, each item has a dependency on the next item, which is why we are required to acquire the locks for insert and delete.

Please log in to leave a comment.