Deadlock
In a multi programming environment several processes may compete for a finite number of resources. A process request resources; if the resource is available at that time a process enters the wait state. Waiting process may never change its state because the resources requested are held by other waiting process. This situation is known as deadlock.
Example
• System has 2 disk drives.
• P1 and P2 each hold one disk drive and each needs another one.
• 2 train approaches each other at crossing, both will come to full stop and neither shall start
until other has gone.
• Traffic only in one direction.
• Each section of a bridge can be viewed as a resource.
• If a deadlock occurs, it can be resolved if one car backs up (preempt resources and rollback).
• Several cars may have to be backed up if a deadlock occurs.
• Starvation is possible