Assignment Questions Based on Unit-4 (Deadlock)
1. Define a deadlock in the context of operating systems with an
example.
2. List the necessary conditions for deadlock to occur.
3. Explain how deadlock can be characterized using resource allocation
graphs.
4. Describe the role of detection and recovery mechanisms in handling
deadlocks.
5. Apply the Banker's algorithm to determine if a system is in a safe
state.
6. What is starvation? Hoe we can solve the condition?
7. Consider a system with 5 processes (P0 to P4) and 3 resource types
(A, B, C). The system has the following total resources:
A = 10, B = 5, C = 7
Following are the details given
Allocation Matrix (Resources already allocated)
Process A B C
P0 2 1 4
P1 2 0 1
P2 3 4 2
P3 2 1 4
P4 3 5 2
Maximum Matrix (Max resources needed by each process)
Process A B C
P0 5 5 3
P1 8 2 2
P2 9 0 2
P3 2 4 2
P4 4 3 6
Calculate the Need Matrix and check whether the system is in safe or
unsafe state.