3. What is Deadlock ?
A deadlock is a situation in which two computer programs sharing the
same resource are effectively preventing each other from accessing
the resource, resulting in both programs ceasing to function. The
earliest computer operating systems ran only one program at a time.
Deadlock is a situation or condition when two or more processes are holding some
resources and trying to acquire some more resources, and they can not release the
resources until they finish there execution.
5. HOW TO HANDLE DEADLOCKS???
• Four major areas of interest in deadlock research
- Deadlock Prevention
- Deadlock Avoidance
- Deadlock Detection
- Deadlock Recovery
6. Mutual exclusion: only one process at a time can use a resource
Hold and wait: processes currently holding resources can request new
resources.
No preemption: Once a process holds a resource, it cannot be taken away by
another process or the kernel.
Circular wait: Each process is waiting to obtain a resource which is held by
another process.
DEADLOCK PREVENTION???
Prevention eliminates one of four conditions
7. • Maximum requirements of
each resource must be stated in advance by each process.
• Two Approaches
• Two Algorithms
o Resource Allocation Algorithms
o The Banker’s Algorithm
DEADLOCK AVOIDANCE