Concurrency: Deadlock and Starvation

Deadlock

Example where deadlock can occur

Example where deadlock cannot occur

The Conditions for Deadlock

The Conditions for Deadlock

The Conditions for Deadlock

Methods for handling deadlocks

Deadlock Prevention

Indirect methods of deadlock prevention

Indirect methods of deadlock prevention

Direct methods of deadlock prevention

Prevention of circular wait

Prevention of circular wait

Deadlock Prevention: Summary

Deadlock Avoidance

Resource types

Process initiation denial

Process initiation denial

Resource allocation denial: the banker’s algorithm

The banker’s algorithm

The banker’s algorithm

The banker’s algorithm

The banker’s algorithm

The banker’s algorithm

Example of the banker’s algorithm

Example of the banker’s algorithm

Example of the banker’s algorithm

banker’s algorithm: comments

Deadlock Detection

A deadlock detection algorithm

Deadlock detection: comments

Deadlock detection: example

Deadlock Recovery

Deadlock Recovery (cont.)

An integrated deadlock strategy