Introduction to Operating Systems: Unit II(b): Deadlock

Comparison Between Detection, Prevention and Methods of Handling Deadlock

Deadlock - Introduction to Operating Systems

This implies that each process is holding one resource and is waiting for one more. Since there are three processes and four resources, one process must be able to obtain two resources.

Comparison between Detection, Prevention and Avoidance Methods of Handling Deadlock

Example 3.8.1 Consider a system consisting of four resources of the same type that are shared by three processes, each of which needs at most two resources. Show the system is deadlock-free.

Solution: Yes, this system is deadlock-free.

Maximum resources R1 = 4

Three processes: P1, P2, P3

• This implies that each process is holding one resource and is waiting for one more. Since there are three processes and four resources, one process must be able to obtain two resources. This process requires no more resources and, therefore it will return its resources when done.

• Need of P1 process is one resource, so it get from available. After getting one resources, process P1 releases both the resources which it hold.

• So available resource will become 2 and it allocate one by one to all remaining process. In this way, system fulfill all the needs of process. System will not enter into deadlock state.

Introduction to Operating Systems: Unit II(b): Deadlock : Tag: : Deadlock - Introduction to Operating Systems - Comparison Between Detection, Prevention and Methods of Handling Deadlock


Introduction to Operating Systems: Unit II(b): Deadlock



Under Subject


Introduction to Operating Systems

CS3451 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation



Related Subjects


Environmental Sciences and Sustainability

GE3451 ESS 4th Semester | 2021 Regulation | 4th Semester EEE Dept 2021 Regulation


Theory of Computation

CS3452 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation


Artificial Intelligence and Machine Learning

CS3491 4th Semester CSE/ECE Dept | 2021 Regulation | 4th Semester CSE/ECE Dept 2021 Regulation


Database Management System

CS3492 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation


Algorithms

CS3401 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation


Introduction to Operating Systems

CS3451 4th Semester CSE Dept | 2021 Regulation | 4th Semester CSE Dept 2021 Regulation