Deadlocks UGC

Question 1
Suppose a system has 12 instances of some resources with n processes competing for that resource. Each process may require 4 instances of the resource. The maximum value of n for which the system never enters into deadlock is
Tick
3
Cross
4
Cross
5
Cross
6


Question 1-Explanation: 
Given, Number of resources (R) = 12 Max need for each resource (N) = 3 Since deadlock-free condition is:
R ≥ P(N − 1) + 1 
Where R is total number of resources, P is the number of processes, and N is the max need for each resource.
12 ≥ P(4 − 1) + 1
11 ≥ 3P
11/3 ≥ P
P ≤ 3.66 
(Take, floor value for maximum) Therefore, the largest value of P that will always avoid deadlock is 3. Option (A) is correct.
Question 2
​To overcome difficulties in Readers-Writers problem, which of the following statement/s is/are true ?
  1. Writers are given exclusive access to shared objects
  2. Readers are given exclusive access to shared objects
  3. Both readers and writers are given exclusive access to shared objects.
Choose the correct answer from the code given below:
Tick
1 only
Cross
Both 2 and 3
Cross
2 only
Cross
3 only


Question 2-Explanation: 
In Readers-Writers Problem, since readers do not modify values, so these can be allowed with other readers. But writers are given exclusive access to shared objects. Only statement (1) is correct.
Question 3
Suppose P, Q and R are co-operating processes satisfying Mutual Exclusion condition. Then if the process Q is executing in its critical section then
Cross
‘P’ executes in critical section
Cross
‘R’ executes in critical section
Tick
Neither ‘P’ nor ‘Q’ executes in their critical section
Cross
Both ‘P’ and ‘R’ executes in critical section


Question 3-Explanation: 
Mutual exclusion is a property of process synchronization which states that “no two processes can exist in the critical section at any given point of time”. The term was first coined by Djikstra. Any process synchronization technique being used must satisfy the property of mutual exclusion, without which it would not be possible to get rid of a race condition. So, option (C) is correct.
Question 4
A computer has six tape drives with n processes competing for them. Each process may need two drives. What is the maximum value of n for the system to be deadlock-free?
Tick
5
Cross
4
Cross
3
Cross
6


Question 4-Explanation: 
Each process needs 2 drives. So for deadlock just give each process one drive. So total 6 processes can be given 1 drive each and can cause deadlock. So to break the deadlock just reduce 1 process. So maximum no. of processes for the system to be deadlock-free is 5.
There are 4 questions to complete.

  • Last Updated : 10 Aug, 2021

Share your thoughts in the comments
Similar Reads