Previous | Next --- Slide 5 of 31
Back to Lecture Thumbnails
Elias

Since I made this mistake proposing the solution in lecture, I feel it's worth pointing it out. The first step along the path to a performant solution is to wrap insert/delete in coarse locks. That works fine for insert, because execution is guaranteed to exit ONLY from the end of the function. But for delete, you have to be sure to unlock once you delete, or you'll end up in a deadlock situation, because you've still got the lock.