Consider a system has three processes and three resources are availabl...
Deadlock occur if each and every process holds one resource and request resource of other process such that circular wait condition get satisfied. Let A, B, C be these processes holding one process each.
View all questions of this test
Consider a system has three processes and three resources are availabl...
Understanding the System Configuration
In this scenario, we have three processes (P1, P2, P3) and three identical resources available. Each process can claim a maximum of two resources.
Resource Allocation
- Each process can request two resources at most.
- Total resources available = 3.
- If all three processes claim their maximum (2 each), it exceeds the total available resources.
Deadlock Conditions
For a deadlock to occur, the following four conditions must hold:
1. Mutual Exclusion: Resources cannot be shared.
2. Hold and Wait: Processes holding resources can wait for more.
3. No Preemption: Resources cannot be forcibly taken from a process.
4. Circular Wait: A cycle of processes exists, each waiting for a resource held by another.
Analysis of Deadlock
- Given three processes and three resources, a deadlock can occur. For example:
- P1 holds 1 resource and waits for 1 more.
- P2 holds 1 resource and waits for 1 from P1.
- P3 holds 1 resource and waits for 1 from P2.
This creates a circular wait, satisfying all deadlock conditions.
Conclusion
- Deadlock May Occur (Correct Answer: C): The configuration allows for a situation where processes may wait indefinitely for resources, leading to a deadlock scenario.
- Thrashing: This does not apply here, as it refers to excessive paging in memory management, not resource allocation.
- Deadlock Never Occurs: This is incorrect due to the possibility of circular wait.
- Starvation: While processes may wait indefinitely, it does not guarantee starvation as they might still eventually acquire resources.
Hence, the correct answer is that deadlock may occur in the system.