Operating Systems · Unit 3 · 6 hrs
Process Deadlocks
Exam-focused notes for Process Deadlocks (Operating Systems, CSC264): what the TU syllabus asks and how it has actually been tested, with 10 solved past questions from this unit.
What this unit covers
- Introduction
- Deadlock Characterization
- Preemptable and Non-preemptable Resources
- Resource - Allocation Graph
- Conditions for Deadlock
- Handling Deadlocks: Ostrich Algorithm, Deadlock prevention, Deadlock Avoidance, Deadlock Detection (For Single and Multiple Resource Instances), Recovery From Deadlock (Through Preemption and Rollback)
Handling Deadlocks
How do you think deadlock can be avoided? Explain. [5]
Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. No process can proceed, release, or be preempted. --- For a deadlock to occur, all four ...
Full solved answer →Banker's Algorithm Analysis
All files reside in one common directory shared by all users. Advantages: Simple to implement, easy to search, fast access. Disadvantages: All file names must be unique (naming collision), unsuitable for multiple users, becomes unmanageable as file count gr...
Full solved answer →How unsafe state differs from deadlocked state? Consider the following initial state and identify whether requested is granted or denied for the given cases. What will happen if process D requests 1 resource? What will happen if process A requests 1 resource?
| Process | Has | Max |
|---|---|---|
| A | 2 | 6 |
| B | 1 | 5 |
| C | 2 | 3 |
| D | 3 | 8 |
$$\text{Free} = 2$$
[10]
Process Has Max Need = Max − Has ------------------------------------- A 2 6 4 B 1 5 4 C 2 3 1 D 3 8 5 Free = 2 Total resources $= (2+1+2+3) + 2 = 10$ (single resource type). --- Aspect Unsafe State Deadlocked State -------------------------------------- De...
Full solved answer →What is resource allocation graph? Explain the process of detecting deadlocks when there is single instance of each resources with suitable example? [5]
A Resource Allocation Graph is a directed graph used to precisely describe and detect deadlocks in a system. It consists of: - Vertices (V): Two types: - P = {P1, P2, ..., Pn} - set of all active processes (represented as circles) - R = {R1, R2, ..., Rm} - ...
Full solved answer →Differentiate between deadlock and starvation? Discuss the process of detecting deadlocks when there are multiple resources of each type. [5]
--- Aspect Deadlock Starvation --------- Definition A situation where a set of processes are permanently blocked, each holding a resource and waiting for a resource held by another process in the set A situation where a process waits indefinitely because ot...
Full solved answer →Illustrate the term safe and unsafe state in deadlock prevention with scenario. [5]
The concept of safe and unsafe states is central to deadlock avoidance (specifically the Banker's Algorithm), where the OS checks whether granting a resource request will lead to a safe or unsafe state before actually granting it. : "What the algorithm does...
Full solved answer →Conditions for Deadlock
Can deadlock occur in case of preemptive resources? List the conditions for deadlock. Define allocation graph with example.[10]
--- No, deadlock cannot occur in the case of preemptive resources. One of the four necessary conditions for deadlock is No Preemption, which states: "A process acquiring a resource cannot be preempted in between to release the acquired resource. Instead, th...
Full solved answer →Introduction
Distinguish between starvation and deadlock. How does the system schedule process using multiple queues? [5]
--- Basis Deadlock Starvation --------- Definition A situation where a set of processes are blocked, each waiting for a resource held by another process in the same set, so none can proceed. A situation where a process waits indefinitely because other proce...
Full solved answer →Resource - Allocation Graph
Write short notes on: a. Linux File System b. Resource Allocation Graph [5]
--- The Linux File System refers to how a Linux-based computer organizes, stores, and manages system files. It is basically a combination of directories (folders) that serve as placeholders for addresses of other files. - In Linux, there is no distinction b...
Full solved answer →Deadlock Characterization
How do you distinguish between deadlock and starvation? Describe. Explain working mechanism of TLB.[10]
--- Definition: Deadlock is a situation in a multiprogramming environment where a set of processes are blocked permanently because each process in the set is holding a resource and waiting to acquire a resource held by another process in the same set. None ...
Full solved answer →Make Unit 3 stick
Practice CSC264 with flashcards & quizzes