Deadlocking Revisited

Remember the deadlock problem?

Well, it exists in the shared-memory model as well

In general, it exists whenever multiple parties are competing for exclusive access to multiple resources

How can we avoid deadlocks?

Deadlock detection
Expensive
What to do when discover a deadlock?
Impose strict ordering on locks
e.g., if need to lock both A and B, always lock A first, then lock B

Lock A

Lock B

A

B

Previous slide Next slide Back to first slide View graphic version