Deadlock

Question 1

Consider the following snapshot of a system running n concurrent processes. Process i is holding Xi instances of a resource R, 1 ≤ i ≤ n. Assume that all instances of R are currently in use. Further, for all i, process i can place a request for at most Yi additional instances of R while holding the Xi instances it already has. Of the n processes, there are exactly two processes p and q such that Yp = Yq = 0. Which one of the following conditions guarantees that no other process apart from p and q can complete execution?

A
Min (Xp, Xq) ≥ Min {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
B
Xp + Xq < Max {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
C
Min (Xp, Xq) ≤ Max {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
D
Xp + Xq < Min {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
       Operating-Systems       Deadlock       GATE 2019
Question 1 Explanation: 
{P1, P2, ..., Pn}
Pi holds Xi instances.
Pi can request additional Yi instances.
Given two process p & q such that their additional requests are zero.
Yp = Yq = 0
{Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q} means that out of 'n' processes, we are left with (n-2) process (except p&q), i.e., Yk indicates additional request of all the processes (n-2) except p & q.
For p & q to complete first, accordingly
Xp + Xq < Min {Yk}
Option D is correct.
There are exactly two process p and q which do not need any additional instances of resources.
So, p and q will complete their execution and will release Xp and Xq instances of resources.
Now to guarantee that no other process apart from p and q can complete execution, the no. of instances of resources available must be less than the minimum no. of instances of resources required by any other process, i.e.,
Xp + Xq < Min {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}.
Question 2

Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is _________.

A
2
B
3
C
4
D
5
       Operating-Systems       Deadlock       GATE 2018
Question 2 Explanation: 
No. of process = 3
No. of resources = 4
Let’s distribute each process one less than maximum demands i.e., (k-1) resources.
So, for three processes, 3(k – 1) resources.
For deadlock avoidance provide an additional resource to any one of the process.
∴ Total resources required to avoid deadlock in any case is 3(k – 1) + 1 = 3k – 2
Now this 3k – 2 should be less than equal to available no. of resources, i.e.,
3k – 2 ≤ 4
k ≤ 2
So maximum value of k = 2
Question 3

In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example, Max[P2, F] is the maximum number of instances of F that P2 would require. The number of instances of the resources allocated to the various processes at any given state is given by a matrix named Allocation.

Consider a state of the system with the Allocation matrix as shown below, and in which 3 instances of E and 3 instances of F are the only resources available.

From the perspective of deadlock avoidance, which one of the following is true?

A
The system is in safe state.
B
The system is not in safe state, but would be safe if one more instance of E were available.
C
The system is not in safe state, but would be safe if one more instance of F were available.
D
The system is not in safe state, but would be safe if one more instance of G were available.
       Operating-Systems       Deadlock       GATE 2018
Question 3 Explanation: 
〈E, F, G〉 = 〈3, 3, 0〉

Safe sequence:
〈P0, P2, P1, P3
P0: P0 can be allotted 〈3,3,0〉.
After completion Available = 〈4,3,1〉
P2: P2 can be allotted 〈0,3,0〉.
After completion: Available = 〈5,3,4〉
P1: P1 can be allotted 〈1,0,2〉.
After completion: Available = 〈6,4,6〉
P3: P3 can be allotted 〈3,4,1〉.
After completion: Available = 〈8,4,6〉
Question 4

A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:

Which of the following best describe current state of the system?

A
Safe, Deadlocked
B
Safe, Not Deadlocked
C
Not Safe, Deadlocked
D
Not Safe, Not Deadlocked
       Operating-Systems       deadlock       GATE 2017 [Set-2]
Question 4 Explanation: 

Available: (9 - (3 + 1 + 3)) = 2, P3 can be satisfied.
New available = 3 + 2 = 5
Now, P2 can be satisfied.
New available: 5 + 1 = 6
Now, P1 can be satisfied. Thus safe sequence: P3 → P2 → P1
That is not deadlocked.
Question 5

A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?

A
1
B
2
C
3
D
6
       Operating-Systems       Deadlock       GATE 2015 [Set-2]
Question 5 Explanation: 
Let's assume that each process request 2 resources each. Now there are total 6 identical resources available. Give 1 resource to every processes then there will be deadlock because now each process will wait for another resource which is not available, so there will be deadlock. Since there are total 6 resources so for deadlock to be possible there should be 6 processes available. Hence, the value of N is 6.
Question 6

Consider the following policies for preventing deadlock in a system with mutually exclusive resources.

    I. Processes should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released.
    II. The resources are numbered uniquely, and processes are allowed to request for resources only in increasing resource numbers.
    III. The resources are numbered uniquely, and processes are allowed to request for resources only in decreasing resource numbers.
    IV. The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger than its currently held resources.

Which of the above policies can be used for preventing deadlock?

A
Any one of I and III but not II or IV
B
Any one of I, III, and IV but not II
C
Any one of II and III but not I or IV
D
Any one of I, II, III, and IV
       Operating-Systems       Deadlock       GATE 2015 [Set-3]
Question 6 Explanation: 
All are deadlock prevention strategies.
Question 7

A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________.

A
7
B
8
C
9
D
10
       Operating-Systems       Deadlock       GATE 2014 [Set-3]
Question 7 Explanation: 
(3*2 tape units) + 1 tape unit = 7
Question 8

A system has n resources R0,...,Rn-1,and k processes P0,....Pk-1.The implementation of the resource request logic of each process Pi is as follows:

if (i % 2 == 0) {
      if (i < n) request Ri
      if (i+2 < n) request Ri+2
}
else {
      if (i < n) request Rn-i
      if (i+2 < n) request Rn-i-2
}

In which one of the following situations is a deadlock possible?

A
n = 40, k = 26
B
n = 21, k = 12
C
n = 20, k = 10
D
n = 41, k = 19
       Operating-Systems       Deadlock       GATE 2010
Question 8 Explanation: 
Consider the case where i = 10 & i = 11, n = 21 & k = 12
P10 requests R10 & R11
P11 requests R10 & R8
Hence P10 & P11 inorder in deadlock.
Question 9

Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2 units). A non-preemptive resource allocation policy is used. At any given instance, a request is not entertained if it cannot be completely satisfied. Three processes P1, P2, P3 request the sources as follows if executed independently.

Which one of the following statements is TRUE if all three processes run concurrently starting at time t=0?

A
All processes will finish without any deadlock.
B
Only P1 and P2 will be in deadlock.
C
Only P1 and P3 will be in a deadlock.
D
All three processes will be in deadlock.
       Operating-Systems       Deadlock       GATE 2009
Question 9 Explanation: 
At t=0,
→ P1 requests 2 units of R2 which is granted.
→ P2 requests 2 units of R3 which is granted.
→ P3 requests 1 units of R4 which is granted.
Now Available resources are,

At t=1,
→ P1 requests 1 unit of R3 which is granted because it is available.
Now Available resources are,

At t=2,
→ P2 requests 1 unit of R4 which is granted.
→ P3 requests 2 units of R1.
Now Available resources are,

At t=3,
→ P1 requests 2 units of R1 which cannot be granted, and will wait for other processes to release.
Available resources are,

At t=4,
→ P2 requests 1 unit of R1, which is granted.
Available resources are

At t=5,
→ P3 releases 2 units of R1.
Now Available resources are,

→ Now P1 is waiting for R1, so now P1 will be granted 2 units of R1.
Now Available resources are,

→ Now P1 releases 1 unit of R2 and 1 unit of R1.
Now Available resources are

At t=6,
→ Now P2 releases 1 unit of R3.
Now available resources are,

At t=7,
→ P3 requests 1 unit of R2, which is granted.
→ P1 releases 1 unit of R3.
Now Available resources are,

At t=8,
→ P2 fnishes and releases remaining resources. So now Available resources,

→ P3 requests 1 unit of R3 which is granted.
Now Available resources are,

→ P1 requests 2 units of R4 which cannot be granted, so it will wait for other process to release them.
At t=9,
→ P3 finishes, and releases rest of the resources.
Now Available resources are

→ Now, P1 can be granted with resources 2 units of R4 for which it was waiting for.
Now Available resources are,

At t=10,
→ P1 finishes its execution.
So, finally we can conclude that all processes will finish without any deadlock.
Question 10

Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?

A
In deadlock prevention, the request for resources is always granted if the resulting state is safe
B
In deadlock avoidance, the request for resources is always granted if the result state is safe
C
Deadlock avoidance is less restrictive than deadlock prevention
D
Deadlock avoidance requires knowledge of resource requirements a priori
       Operating-Systems       Deadlock       GATE 2008
Question 10 Explanation: 
Deadlock prevention scheme handles deadlock by making sure that one of the four necessary conditions don't occur. So, it may be the case that a resource request might be rejected even if the resulting state is safe. Hence, option (A) is false.
Question 11

Consider the following snapshot of a system running n processes. Process i is holding xi instances of a resource R, 1≤i≤n. Currently, all instances of R are occupied. Further, for all i, process i has placed a request for an additional yi instances while holding the xi instances it already has. There are exactly two processes p and q such that yp = yq = 0. Which one of the following can serve as a necessary condition to guarantee that the system is not approaching a deadlock?

A
min (xp, xq) < maxk≠p,qyk
B
xp + xq ≥ mink≠p,qyk
C
max (xp, xq) > 1
D
min (xp, xq) > 1
       Operating-Systems       Deadlock       GATE 2006
Question 11 Explanation: 
Deadlock refers stops the execution of process due to non-availability of resources.
→ When two (or) more processes waiting for another process to release the resources.
→ P and Q can execute if they have sufficient resources, they don’t wait for extra resources (i.e., Xp+ Xq) required.
→ Option B can satisfies the corresponding equation i.e., Xp+ Xq >= min(Yk) where k != p and k != q.
Here we have sufficient resources.
Question 12

Suppose n processes, P1, …., Pn share m identical resource units, which can be reserved and released one at a time. The maximum resource requirement of process Pi is si, where si>0. Which one of the following is a sufficient condition for ensuring that deadlock does not occur?

A
B
C
D
       Operating-Systems       Deadlock       GATE 2005
Question 12 Explanation: 
In the extreme situation, we have si - 1 resources and we require one more resource.
If the deadlock will never occur in the corresponding process then the following condition be true.
Question 13

Which of the following is NOT a valid deadlock prevention scheme?

A
Release all resources before requesting a new resource
B
Number the resources uniquely and never request a lower numbered resource than the last one requested
C
Never request a resource after releasing any resource
D
Request and all required resources be allocated before execution
       Operating-Systems       Deadlock       GATE 2000
Question 13 Explanation: 
Given statement is wrong. We can request a resource after releasing any resource.
Question 14

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?

A
6
B
5
C
4
D
3
       Operating-Systems       Deadlock       GATE 1998
Question 14 Explanation: 
Each process needs 2 drives. So for deadlock just give each process one drive. So total 6 process can be given 1 drive each and can cause deadlock. So to break deadlock just reduce 1 process.
So maximum no. of process for the system to be deadlock free is 5.
Question 15

An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of r such that no deadlocks will ever arise is

A
3
B
5
C
4
D
6
       Operating-Systems       Deadlock       GATE 1997
Question 15 Explanation: 
For the system to cause deadlock give each process 1 resource less than they require. Since in this case they require 2 resource each, so just give them 1 resource each. So if at max if 3 resource will be available then there can be deadlock. So by adding one more resource deadlock will never occur. So in total minimum 4 resources are required so that deadlock will never occur.
Question 16

A solution to the Dining Philosophers Problem which avoids deadlock is

A
ensure that all philosophers pick up the left fork before the right fork
B
ensure that all philosophers pick up the right fork before the left fork
C
ensure that one particular philosopher picks up the left fork before the right fork, and that all other philosophers pick up the right fork before the left fork
D
None of the above
       Operating-Systems       Deadlock       GATE 1996
Question 16 Explanation: 
In the Dining philosopher problem, each philosopher needs exactly two chopsticks to eat food but the problem is: each philosopher is going to take one chopstick at a time, which is placed at its right-hand side or at its left-hand side, but remember all should choose in the same manner like if first one chooses in a clockwise manner then each one should choose in clockwise, this type of picking cause, a circular waiting loop because each one is depending on other. This is also called as circular waiting and it leads to deadlock.
To avoid this, atleast one philosopher should choose its first chopstick in different way so that circular loop is not formed.
Question 17

Consider a system having m resources of the same type. These resources are shared by 3 processes A, B and C, which have peak demands of 3, 4 and 6 respectively. For what value of m deadlock will not occur?

A
7
B
9
C
13, 15
D
13
E
15
       Operating-Systems       Deadlock       GATE 1993
Question 17 Explanation: 
A requires 3, B-4, C-6;
→ If A have 2, B have 3, C have 5 then deadlock will occur i.e., 2+3+5=10.
→ If we have one extra resource then deadlock will not occur i.e., 10+1=11.
→ If we have equal (or) more than 11 resources then deadlock will never occur.
Question 18

Assume that the following jobs are to be executed on a single processor system

The jobs are assumed to have arrived at time 0+ and in the order p, q, r, s, t. Calculate the departure time (completion time) for job p if scheduling is round robin with time slice 1.

A
4
B
10
C
11
D
12
E
None of the above
       Operating-Systems       Deadlock       GATE 1993
Question 18 Explanation: 
Algorithm: Round robin; TQ: 1

p is departure at 11.
Question 19

A computer system has 6 tape drives, with n process completing for them. Each process may need 3 tape drives. The maximum value of n for which the system is guaranteed to be deadlock free is:

A
2
B
3
C
4
D
1
       Operating-Systems       Deadlock       GATE 1992
Question 19 Explanation: 
Lets give 2 tape driver to each process, so that there will be deadlock. So 3 processes will be given two drives each so that there will be deadlock. So to avoid deadlock maximum no. of process should be 1 less than the minimum no. of process that will cause deadlock. So for n=2, the system is guaranteed to be deadlock free.
Question 20

An operating system implements a policy that requires a process to release all resources before making a request for another resource. Select the TRUE statement from the following:

A
Both starvation and deadlock can occur
B
Starvation can occur but deadlock cannot occur
C
Starvation cannot occur but deadlock can occur
D
Neither starvation nor deadlock can occur
       Operating-Systems       Deadlock       GATE 2008-IT
Question 20 Explanation: 
Starvation can occur as each time a process requests a resource it has to release all its resources.
Now, maybe the process has not used the resources it released yet. This may happen again when the process requests another resource.
So, the process starved for proper utilization of resources.
Deadlock will not occur as it is one of the deadlock prevention scheme.
Question 21

Two shared resources R1 and R2 are used by processes P1 and P2. Each process has a certain priority for accessing each resource. Let Tij denote the priority of Pi for accessing Rj. A process Pi can snatch a resource Rh from process Pj if Tik is greater than Tjk. Given the following:

(I) T11 > T21
(II) T12 > T22
(III) T11 < T21
(IV) T12 < T22 
Which of the following conditions ensures that P1 and P2 can never deadlock?

A
(I) and (IV)
B
(II) and (III)
C
(I) and (II)
D
None of the above
       Operating-Systems       Deadlock       GATE 2005-IT
Question 21 Explanation: 
If all resources are allocated to one process then deadlock will never occur. So, if we allocate both R1 and R2 to process P1 or both R1 and R2 to process P2 then deadlock will never occur. So when one process will complete its execution then both the resources are allocated to the other process. So, either condition (I) and (II) or (III) and (IV) ensures that deadlock will never occur.
Question 22
Processes P1 and P2 have a producer-consumer relationship, communicating by the use of a set of shared buffers. Increasing the number of buffers is likely to do which of the following? I. Increase the rate at which requests are satisfied (throughput) II. Decrease the likelihood of deadlock III. Increase the ease of achieving a correct implementation
A
III Only
B
II Only
C
I Only
D
II and III Only
       Operating-Systems       Deadlock       ISRO-2018
Question 22 Explanation: 
It only satisfied statement I. because increasing the memory size increases the rate at which requests are satisfied but can not alter the possibility of deadlock and neither does it play any role in implementation.
Question 23
Consider a job scheduling problem with 4 jobs J1, J2, J3, J4 and with corresponding deadlines: ( d1, d2, d3, d4) = (4, 2, 4, 2).
Which of the following is not a feasible schedule without violating any job schedule?
A
J2, J4, J1, J3
B
J4, J1, J2, J3.
C
J4, J2, J1, J3.
D
J4, J2, J3, J1
       Operating-Systems       Deadlock       ISRO-2007
Question 23 Explanation: 
→ Feasible schedule is completing all the jobs within deadline.
→ From the dead line, we can deduce that Job J2 & J4 will complete by time “2” whereas remaining two requires time “4”.
→ So the order of completion of Jobs are Either J2 or J4 and followed by either J1 or J3.
From the given options , Option A,C & D gives the solution because after completion of Jobs J2 and J4 then only jobs J1 and J3 is going to complete.
→ But option B , order of completing jobs is J4,J1,J2 ,J3 which is not possible and it is not feasible schedule
Question 24
Consider a system having ‘m’ resources of the same type. The resources are shared by 3 processes A, B, C, which have peak time demands of 3, 4, 6 respectively. The minimum value of ‘m’ that ensures that deadlock will never occur is
A
11
B
12
C
13
D
14
       Operating-Systems       Deadlock       ISRO-2007
Question 24 Explanation: 
Minimum resources required to avoid deadlock = (m1 – 1) + (m2 – 1) +..+ (my – 1) + 1
where m = resource required by process
y = number of processes
so, Number of resources that ensures that deadlock will never occur is = (3-1) + (4-1) + (6-1) + 1 = 11
Option (A) is correct.
Question 25
Consider a system having m resources of the same type. These resources are shared by 3 processes A, B, C which have peak time demands of 3, 4, 6 respectively. The minimum value of m that ensures deadlock will never occur is
A
11
B
12
C
13
D
14
       Operating-Systems       Deadlock       ISRO-2018
Question 25 Explanation: 
A requires 3, B-4, C-6;
→ If A has 2, B has 3, C has 5 then a deadlock will occur i.e., 2+3+5=10.
→ If we have one extra resource then a deadlock will not occur i.e., 10+1=11.
→ If we have equal (or) more than 11 resources then deadlock will never occur.
Question 26
What problem is solved by Dijkstra banker’s algorithm?
A
Cache coherence
B
Mutual exclusion
C
Deadlock recovery
D
Deadlock avoidance
       Operating-Systems       Deadlock       ISRO-2017 May
Question 26 Explanation: 
Deadlock avoidance is solved by Dijkstra banker’s algorithm
Question 27
In which of the following four necessary conditions for deadlock processes claim exclusive control of the resources they require?
A
no preemption
B
mutual exclusion
C
circular wait
D
hold and wait
       Operating-Systems       Deadlock       ISRO CS 2008
Question 27 Explanation: 
Mutual Exclusion is a condition when one or more than one resource are non-sharable (Only one process can use at a time) i.e. processes claim exclusive control of the resources they require.
Question 28
Consider a system having “n” resources of same type. These resources are shared by 3 processes, A, B, C. These have peak demands of 3, 4, and 6 respectively. For what value of “n” deadlock won’t occur
A
15
B
9
C
10
D
11
       Operating-Systems       Deadlock       ISRO CS 2009
Question 28 Explanation: 
Number of min resources required = (3-1) + (4-1) + (6-1) + 1 = 11
Question 29
With single resource, deadlock occurs
A
If there are more than two processes competing for that resources
B
If there are only two processes competing for that resources
C
If there is a single process competing for that resources
D
None of these
       Operating-Systems       Deadlock       ISRO-2016
Question 29 Explanation: 
Only Single resource available never occur deadlock because it violates circular wait and hold & wait condition.
Question 30
A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units, then
A
Deadlock can never occur
B
Deadlock may occur
C
Deadlock has to occur
D
None of these
       Operating-Systems       Deadlock       ISRO-2016
Question 30 Explanation: 
If the system is deadlocked, it implies that each process is holding one resource and is waiting for one more. Since there are 3 processes and 4 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.
Question 31
When a process is rolled back as a result of deadlock the difficulty which arises is
A
Starvation
B
System throughput
C
Low device utilization
D
Cycle stealing
       Operating-Systems       Deadlock       ISRO CS 2009
Question 31 Explanation: 

→ When a process is rolled back as a result of deadlock the difficulty which arises is starvation.
→ Resource starvation is a problem encountered in concurrent computing where a process is perpetually denied necessary resources to process its work.
→ Starvation may be caused by errors in a scheduling or mutual exclusion algorithm, but can also be caused by resource leaks, and can be intentionally caused via a denial-of-service attack such as a fork bomb
Question 32
A total of 9 units of a resource type available, and given the safe state shown below, which of the following sequence will be a safe state?
A
(P4, P1, P3, P2)
B
(P4, P2, P1, P3)
C
(P4, P2, P3, P1)
D
(P3, P1, P2, P4)
       Operating-Systems       Deadlock       ISRO CS 2011
Question 32 Explanation: 

Question 33
Which of the following is not a necessary condition for deadlock?
A
Mutual exclusion
B
Reentrancy
C
Hold and wait
D
No pre-emption
       Operating-Systems       Deadlock       ISRO CS 2013
Question 33 Explanation: 
Four Necessary and Sufficient Conditions for Deadlock are:
→Mutual exclusion
The resources involved must be unshareable; otherwise, the processes would not be prevented from using the resource when necessary.
→Hold and wait or partial allocation
The processes must hold the resources they have already been allocated while waiting for other (requested) resources. If the process had to release its resources when a new resource or resources were requested, deadlock could not occur because the process would not prevent others from using resources that it controlled.
→No pre-emption
The processes must not have resources taken away while that resource is being used. Otherwise, deadlock could not occur since the operating system could simply take enough resources from running processes to enable any process to finish.
→Resource waiting or circular wait
A circular chain of processes, with each process holding resources which are currently being requested by the next process in the chain, cannot exist. If it does, the cycle theorem (which states that "a cycle in the resource graph is necessary for deadlock to occur") indicated that deadlock would occur
Question 34
What are the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P1, P2 and P3 running in a system whose maximum demand for the resources of the same type are 3, 4, and 5 respectively?
A
3
B
7
C
9
D
10
       Operating-Systems       Deadlock       ISRO CS 2014
Question 34 Explanation: 
let the resources needed by P1 is R1 =3,
the number of resources needed by P2 is R2 = 4 and so on.
. Minimum resources required to ensure that deadlock will never occur = (R1-1) + (R2-1) + (R3-1) + 1
= (3-1) + (4-1)+ (5-1) + 1 = 10.
Question 35
The Banker's algorithm is used:
A
to rectify deadlock
B
to prevent deadlock
C
to detect deadlock
D
to detect and solve deadlock
       Operating-Systems       Deadlock       Nielit Scientist-B IT 4-12-2016
Question 35 Explanation: 
● The Banker algorithm, sometimes referred to as the detection algorithm, is a resource allocation and deadlock avoidance algorithm ● This algorithm tests for safety by simulating the allocation of predetermined maximum possible amounts of all resources, and then makes an "s-state" check to test for possible deadlock conditions for all other pending activities, before deciding whether allocation should be allowed to continue.
Question 36

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

A
‘P’ executes in critical section
B
‘R’ executes in critical section
C
Neither ‘P’ nor ‘Q’ executes in their critical section
D
Both ‘P’ and ‘R’ executes in critical section
       Operating-Systems       Deadlock       UGC-NET CS 2018 DEC Paper-2
Question 36 Explanation: 
• A mutual exclusion (mutex) is a program object that prevents simultaneous access to a shared resource.
• This concept is used in concurrent programming with a critical section, a piece of code in which processes or threads access a shared resource.
• Only one thread owns the mutex at a time, thus a mutex with a unique name is created when a program starts.
• When a thread holds a resource, it has to lock the mutex from other threads to prevent concurrent access of the resource.
• In the question, three processes are cooperating processes and satisfying mutual exclusion condition. If process Q is executing in its critical section means remaining two processes in wait stating and they won’t enter into critical section.
Question 37
Consider the following snapshot of a system running n processes. Process i is holding Xi instances of a resource R, 1<=i<=n. Currently, all instances of R are occupied. Further, for all i, process i has placed a request for an additional Yi instances while holding the Xi instances it already p and q such that Yp=Yp=0. which one of the following can serve as a necessary condition to guarantee that the system is not approaching a deadlock?
A
min(Xp,Xq)i)where i!=p and i!=q
B
Xp+Xq>=min(Yi)where i!=p and i!=q
C
max(Xp,Xq) >1
D
min(Xp,Xq)>1
       Operating-Systems       Deadlock       Nielit Scientist-B CS 22-07-2017
Question 37 Explanation: 
Deadlock refers stops the execution of process due to non-availability of resources.
→ When two (or) more processes waiting for another process to release the resources.
→ P and Q can execute if they have sufficient resources, they don’t wait for extra resources (i.e., Xp+ Xq) required.
→ Option B can satisfies the corresponding equation i.e., Xp+ Xq >= min(Yk) where k != p and k != q.
Here we have sufficient resources.
Question 38
A system has n resources R0,..,Rn-1 and k processes P0,..Pk-1. The implementation of the resources request logic of each process Pi is a follows:
if(i%2==0)
{
if(i<n) request Ri
if(i+2 <n) request Ri+2
}
else
{
if(i<n) request Rn-i
if(i+2 < n) request Rn-i-2
}
In which one of the following situations is a deadlock possible?
A
n=40, k=26
B
n=21, k=12
C
n=20, k=10
D
n=41, k=19
       Operating-Systems       Deadlock       Nielit Scientist-B CS 22-07-2017
Question 38 Explanation: 
Consider the case where i = 10 & i = 11, n = 21 & k = 12
P10 requests R10 & R11
P11 requests R10 & R8
Hence P10 & P11 inorder in deadlock.
Question 39
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is__
A
6
B
7
C
8
D
9
       Operating-Systems       Deadlock       Nielit Scientist-B CS 22-07-2017
Question 39 Explanation: 
Three programs and each requires 3 tapes.
We will allocate minimum two tapes to each program then total tapes are 6 and each program requires one more tape to complete its operation.
So, we will allocate one tape to one program and that program will complete its operation.
After completion of operation of one program, all tapes allocated to that program are free. So no need of the extra tape to complete action.
Minimum tapes required are=(3*2 tape units) + 1 tape unit = 7
Question 40
consider a system with m resources of same type being shared by n processes. Resources can be requested and release by processes only one at a time. The system is deadlock free if and only if:
A
The sum of all max needs is
B
the sum of all max needs is >m+n
C
Both of above
D
None
       Operating-Systems       Deadlock       Nielit Scientist-B CS 4-12-2016
Question 40 Explanation: 
Suppose N = Sum of all Needi,
A = Sum of all Allocation,
M = Sum of all Maxi.
Prove:
→ Assume this system is not deadlock free. If there exists a deadlock state, then A = m because there's only one kind of resource and resources can be requested and released only one at a time.
→ From condition b, N + A = M < m + n. So we get N + m < m + n. So we get N < n. It shows that at least one process i that Needi = 0. From condition a, Pi can release at least 1 resource.
→ So there are n-1 processes sharing m resources now, condition a and b still hold. Go on the argument, no process will wait permanently, so there's no deadlock.
Question 41

Banker’s algorithm is used for:

A
Deadlock avoidance
B
Deadlock recovery
C
Deadlock resolution
D
Deadlock prevention
       Operating-Systems       Deadlock       JT(IT) 2018 PART-B Computer Science
Question 41 Explanation: 
Banker’s algorithm is used for Deadlock avoidance.
Question 42
Consider a system having 'm' resources of the same type. these resources are shared by 3 processes A,B,C; which have peak time demands of 3,4,6 respectively. The minimum value of 'm' that ensures that deadlock will never occur is
A
11
B
12
C
13
D
14
       Operating-Systems       Deadlock       Nielit Scientific Assistance IT 15-10-2017
Question 42 Explanation: 
A requires 3, B-4, C-6;
→ If A have 2, B have 3, C have 5 then deadlock will occur i.e., 2+3+5=10.
→ If we have one extra resource then deadlock will not occur i.e., 10+1=11.
→ If we have equal (or) more than 11 resources then deadlock will never occur.
Question 43
An operating system contains 3 user processes each requiring 2 units of resource R. The minimum number of units of R such that no deadlock will ever occur is
A
5
B
2
C
3
D
4
       Operating-Systems       Deadlock       KVS DEC-2017
Question 43 Explanation: 
There are three processes, so there is a possibility to occur deadlock when we are taking 3 resources. If we are taking 3+1 resources means it will never occur deadlock.
Note: If there are ‘n’ processes then ‘n+1’ resources allocated, will never occur deadlock.
Question 44

If a system has multiple instances of resources, to avoid deadlock which of the following algorithms is used?

A
Deadlock avoidance algorithm
B
Aging algorithm
C
Resource allocation graph algorithm
D
Banker’s algorithm
       Operating-Systems       Deadlock       JT(IT) 2016 PART-B Computer Science
Question 44 Explanation: 
Banker's Algorithm :
Banker's algo can be applied even when Resource-system have multiple instances of each resource type. It can also be applied when Resource-system have single instance of each resource type But in that case, It would be less efficient than Resource-Allocation Graph Algorithm.
Question 45
Consider a system with seven processes A through G and six resources R through W. Resource ownership is as follows : process A holds R and wants T process B holds nothing but wants T process C holds nothing but wants S process D holds U and wants S & T process E holds T and wants V process F holds W and wants S process G holds V and wants U Is the system deadlocked ? If yes, ______ processes are deadlocked.
A
No
B
Yes, A, B, C
C
Yes, D, E, G
D
Yes, A, B, F
       Operating-Systems       Deadlock       UGC NET CS 2016 Aug- paper-2
Question 45 Explanation: 

Visual inspection shows that D, E, and G are deadlocked.
Question 46
Consider a system having ‘m’ resources of the same type. These resources are shared by three processes P​ 1​ , P​ 2​ and P​ 3​ which have peak demands of 2, 5 and 7 resources respectively. For what value of ‘m’ deadlock will not occur ?
A
70
B
14
C
13
D
7
E
None of the above
       Operating-Systems       Deadlock       UGC NET CS 2016 Aug- paper-2
Question 46 Explanation: 
A requires 3, B-4, C-7;
→ If A have 2, B have 3, C have 6 then deadlock will occur i.e., 2+3+6=11.
→ If we have one extra resource then deadlock will not occur i.e., 11+1=12.
→ If we have equal (or) more than 12 resources then deadlock will never occur.
Note: Actual answer given option-B but it satisfies option-A,B,C.
Question 47
Suppose there are four processes in execution with 12 instances of a Resource R in a system. The maximum need of each process and current allocation are given below: With reference to current allocation, is system safe ? If so, what is the safe sequence ?
A
No
B
Yes, P​ 1​ P​ 2​ P​ 3​ P​ 4
C
Yes, P​ 4​ P​ 3​ P​ 1​ P​ 2
D
Yes, P​ 2​ P​ 1​ P​ 3​ P​ 4
       Operating-Systems       Deadlock       UGC NET CS 2016 July- paper-2
Question 47 Explanation: 
Step-1: Current allocation for all processors are 3+4+2+1=10.
Step-2: Given total number of resources is 12. But we already allocated 12-10=2.
It means 2 resources are free. we can call M=2
Step-3: P4 requires 2 free resources. Total free resources are 2. So, we can allocate for P4.
Then M become M=3
Step-4: P3 requires 2 free resources. Total free resources are 2. So, we can allocate for P3.
Then M become M=5
Step-5: P1 requires 5 free resources. Total free resources are 5. So, we can allocate for P1.
Then M become M=8
Step-5: P2 requires 5 free resources. Total free resources are 8. So, we can allocate for P2.
Then M become M=12
Note: We have alternative possibility is P4,P3,P2,P1.
Question 48
A system has four processes and five allocatable resources. The current allocation and maximum needs are as follows: The smallest value of ‘x’ for which the above system in safe state is __________.
A
1
B
3
C
2
D
Not safe for any value of x.
       Operating-Systems       Deadlock       UGC NET CS 2015 Dec- paper-2
Question 48 Explanation: 


Case 1: Let’s consider x=1
→ Now need of Process D can be fulfilled. After completing its execution Process D leaves its allocated resources.
→ Now Need of any either Process can’t be fulfilled. So the system is not in safe state with x=1.
Case 2: x=2
Available = 0 0 2 1 1
→ Need of Process D can be fulfilled and after its execution it release its allocated resources.
Available
= 0 0 2 1 1
D
= 1 1 1 1 0
---------------------------------- New available = 1 1 2 2 1
→ Now Need of Process ‘C’ can be fulfilled.
Available
= 1 1 3 2 1
C
= 1 1 0 1 0
----------------------------------
New available = 2 2 3 3 1
→ Now Need of Process ‘B’ can be fulfilled. So new available resources are
Available
= 2 2 3 3 1
C
= 2 0 1 1 0
----------------------------------
New available = 4 2 4 4 1
→ But now need of Process ‘A’ can’t be fulfilled with above available resources. So the system is not in safe state with x=2.
Case 3: x=3
Available = 0 0 3 1 1
→ Now Need of Process ‘D’ can be fulfilled and after its execution it will release its allocated resources.
Available
= 0 0 3 1 1
D
= 1 1 1 1 0
----------------------------------
New available = 1 1 4 2 1
→ Now Need of Process ‘C’ can be fulfilled
Available
= 1 1 4 2 1
C
= 1 1 0 1 0
----------------------------------
New available = 2 2 4 3 1
→ Now Need of Process ‘B’ can be fulfilled
Available
= 2 2 4 3 1
B
= 2 0 1 1 0
----------------------------------
New available = 4 2 5 4 1
→ But with available resource need of Process ‘A’ can’t be fulfilled. So the system is not in safe state with x=3.
→ Hence option (D) is the correct answer.
Question 49
Banker​ ’s algorithm is used for __________ purpose :
A
Deadlock avoidance
B
Deadlock removal
C
Deadlock prevention
D
Deadlock continuations
       Operating-Systems       Deadlock       UGC NET CS 2005 Dec-Paper-2
Question 49 Explanation: 
→ The Banker algorithm, sometimes referred to as the detection algorithm, is a resource allocation and deadlock avoidance algorithm developed by Edsger Dijkstra that tests for safety by simulating the allocation of predetermined maximum possible amounts of all resources, and then makes an "s-state" check to test for possible deadlock conditions for all other pending activities, before deciding whether allocation should be allowed to continue.
Question 50
Banker’s algorithm is for.
A
Deadlock Prevention
B
Deadlock Avoidance
C
Deadlock Detection
D
Deadlock creation
       Operating-Systems       Deadlock       UGC NET CS 2005 june-paper-2
Question 50 Explanation: 
Banker’s algorithm is for deadlock avoidance.
Question 51
A software to create a Job Queue is called ____________ .
A
Linkage editor
B
Interpreter
C
Driver
D
Spooler
       Operating-Systems       Deadlock       UGC NET CS 2006 Dec-paper-2
Question 51 Explanation: 
→ Spooling is a process in which data is temporarily held to be used and executed by a device, program or the system. Data is sent to and stored in memory or other volatile storage until the program or computer requests it for execution.
→ A software to create a Job Queue is called spooler. The spooler maintains an orderly sequence of jobs for the peripheral and feeds it data at its own rate.
Ex: Printer.
Question 52
__________ synchronize critical resources to prevent deadlock.
A
P - operator
B
V - operator
C
Semaphores
D
Hard disk
       Operating-Systems       Deadlock       UGC NET CS 2006 June-Paper-2
Question 52 Explanation: 
Semaphores synchronize critical resources to prevent deadlock.
Operations:
1. wait(P): Decrements the value of semaphore variable by 1. If the new value of the semaphore variable is negative, the process executing wait is blocked (i.e., added to the semaphore queue). Otherwise, the process continues execution, having used a unit of the resource.
wait(S)
{
while (S<=0);
S--;
}
2. signal(V): Increments the value of semaphore variable by 1. After the increment, if the pre-increment value was negative (meaning there are processes waiting for a resource), it transfers a blocked process from the semaphore's waiting queue to the ready queue.
signal(S)
{
S++;
}
Question 53
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
A
3
B
4
C
5
D
6
       Operating-Systems       Deadlock       UGC NET CS 2018-DEC Paper-2
Question 53 Explanation: 
→ Here, every process requirement is 4 instances of the resource.
→ If we allocates 3 instance( one instance less than the requirement of each process) of the resource and to one process we allocate its minimum requirement then in that way with limited available instance of resource, without entering into deadlock we can fulfill requirement of maximum number of processes.
→ Now in question it is given that we have 12 instance then using above strategy we can allocate resources to 3 process without entering into deadlock.
Question 54
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
A
‘P’ executes in critical section
B
‘R’ executes in critical section
C
Neither ‘P’ nor ‘Q’ executes in their critical section
D
Both ‘P’ and ‘R’ executes in critical section
       Operating-Systems       Deadlock       UGC NET CS 2018-DEC Paper-2
Question 54 Explanation: 
● A mutual exclusion (mutex) is a program object that prevents simultaneous access to a shared resource.
● This concept is used in concurrent programming with a critical section, a piece of code in which processes or threads access a shared resource.
● Only one thread owns the mutex at a time, thus a mutex with a unique name is created when a program starts.
● When a thread holds a resource, it has to lock the mutex from other threads to prevent concurrent access of the resource
● In the question, Three process are cooperating processes and satisfying mutual exclusion condition. If process Q is executing in its critical section means remaining two processes in wait stating and they won’t enter into critical section.
Question 55
Consider a system with five processes P0 through P4 and three resource typesR1, R2 and R3. Resource type R1 has 10 instances, R2 has 5 instances and R3has 7 instances. Suppose that at time T0, the following snapshot of the system has been taken :
Allocation
R1 R2 R3
P0 0 1 0
P1 2 0 0
P2 3 0 2
P3 2 1 1
P4 0 2 2
 
Max
R1 R2 R3
P0 7 5 3
P1 3 2 2
P2 9 0 2
P3 2 2 2
P4 4 3 3
 
Available
R1 R2 R3
3 3 2
Assume that now the process P<sub>1</sub> requests one additional instance of type R<sub>1</sub> and two instances of resource type R<sub>3</sub>. The state resulting after this allocation will be
A
Ready state
B
Safe state
C
Blocked state
D
Unsafe state
       Operating-Systems       Deadlock       UGC NET CS 2014 June-paper-2
Question 55 Explanation: 
To find safe state, we need to find need matrix. Need=Max-Allocation

Step-3: Request is less than availability. Then we are subtracting request to available
available= 3-1, 3-0, 2-2
= 2, 3, 0
Step-4: So, we are adding P1 allocation to availability
Availability=2+3, 0+3, 0+2
= 5, 3, 2
Step-5: Next we can serve to P3 then availability is 7 4 3
Step-6: Next. we can serve P4 then availability is 7 4 5
Step-7: Next, we can serve P0 then availability is 7 5 3
Step-8: Next, we can serve P2 then availability is 10 5 7
Hence, The state resulting after this allocation will be safe state.
Question 56
Resources are allocated to the process on non-sharable basis is
A
mutual exclusion
B
hold and wait
C
no pre-emption
D
circular wait
       Operating-Systems       Deadlock       UGC NET CS 2012 June-Paper2
Question 56 Explanation: 
Resources are allocated to the process on non-sharable basis is mutual exclusion.
Question 57
Dijkstra's banking algorithm in an operating system, solves the problem of
A
deadlock avoidance
B
deadlock recovery
C
mutual exclusion
D
context switching
       Operating-Systems       Deadlock       UGC NET CS 2011 Dec-Paper-2
Question 57 Explanation: 
Dijkstra's banking algorithm in an operating system, solves the problem of deadlock avoidance.
Question 58
A special software that is used to create a job queue is called
A
Drive
B
Spooler
C
Interpreter
D
Linkage editor
       Operating-Systems       Deadlock       UGC NET CS 2011 June-Paper-2
Question 58 Explanation: 
A special software that is used to create a job queue is called spooler.
Question 59
A Deadlock in an Operating System Is
A
Desirable process
B
Undesirable process
C
Definite waiting process
D
All of the above
       Operating-Systems       Deadlock       UGC NET CS 2010 Dec-Paper-2
Question 59 Explanation: 
Most appropriate answer is option-B but official key given as option-C. Deadlock is not definite waiting process. We can’t predict it will work after some of time.
Question 60
________ synchronizes critical resources to prevent deadlock.
A
P-operator
B
V-operator
C
Semaphore
D
Swapping
       Operating-Systems       Deadlock       UGC NET CS 2010 June-Paper-2
Question 60 Explanation: 
Semaphore synchronizes critical resources to prevent deadlock.
Question 61
A computer has 6 tape drives with ‘n’ processes competing for them. Each process may need two drives. For which values of ‘n’ is the system deadlock free ?
A
1
B
2
C
3
D
6
E
None of the above
       Operating-Systems       Deadlock       UGC NET CS 2008-june-Paper-2
Question 61 Explanation: 
→ Each process needs 2 drives. So for deadlock just give each process onedrive. So total 6 process can be given 1 drive each and can cause deadlock. So to break deadlock just reduce 1 process.
So, maximum number of process for the system to be deadlock free is 5.
Question 62
Consider a system which have ‘n’ number of processes and ‘m’ number of resource types.The time complexity of the safety algorithm, which checks whether a system is in safe state or not, is of the order of:
A
O(mn)
B
O(m2 n2 )
C
O(m2 n)
D
O(mn2 )
       Operating-Systems       Deadlock       UGC NET CS 2016 Aug- paper-3
Question 62 Explanation: 
Safety algorithm:
1) Let Work and Finish be vectors of length ‘m’ and ‘n’ respectively.
Initialize: Work = Available
Finish[i] = false; for i=1, 2, 3, 4….n
2) Find an i such that both
a) Finish[i] = false
b) Needi <= Work
if no such i exists goto step (4)
3) Work = Work + Allocation[i]
Finish[i] = true
goto step (2)
4) if Finish [i] = true for all i

→ The time complexity of the safety algorithm, which checks whether a system is in safe state or not, is of the order of O(mn2).
Where, ‘n’ number of processes and ‘m’ number of resource types.
Question 63
Consider a system with twelve magnetic tape drives and three processes P1, P2 and P3. Process P1 requires maximum ten tape drives, process P2 may need as many as four tape drives and P3may need up to nine tape drives. Suppose that at time t1, process P1 is holding five tape drives, process P2is holding two tape drives and process P3 is holding three tape drives. At time t1, system is in:
A
safe state
B
unsafe state
C
deadlocked state
D
starvation state
       Operating-Systems       Deadlock       UGC NET CS 2015 Dec - paper-3
Question 63 Explanation: 

Question 64
A computer has six tapes 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?
A
5
B
4
C
3
D
6
       Operating-Systems       Deadlock       UGC NET June-2019 CS Paper-2
Question 64 Explanation: 
Each process needs 2 drives. So for deadlock just give each process one drive. So total 6 process can be given 1 drive each and can cause deadlock. So to break deadlock just reduce 1 process.
So maximum no. of process for the system to be deadlock free is 5.
Question 65
Suppose a system has 12 magnetic tape drives and at time to, three processes are allotted tape drives out of their need as given below: At time to, the system is in safe state. Which of the following is safe sequence so that deadlock is avoided?
A
(p0, p1, p2)
B
(p1, p0, p2)
C
(p2, p1, p0)
D
(p0, p2, p1)
       Operating-Systems       Deadlock       UGC-NET DEC-2019 Part-2
Question 65 Explanation: 


Out of Total 12 resources, 9 resources are allocated. So the remaining resources are 3. With 3 resources process P1 requirements can be fulfilled. So after that total resources will be 3+ resources allocated to P1(i.e. 3+2= 5)
Now process P0 requirement will be fulfilled. So after that total resources will be 5+ resources allocated to P0(i.e. 5+5=10)
Now process P2 requirement will be fulfilled. So after that total resources will be 10+ resources allocated to P2(i.e. 10+2=12)
Question 66
Given total number of instances of a resource to be 18, three processes (Pl, P2, and P3) and the resource requirement and allocation table are given below.
Which of the following orders of process execution forms a safe (deadlock free)

A
< P1,P2,P3>
B
< P3,P1,P2>
C
< P1,P3,P2>
D
< P2,P1,P3>
       Operating-Systems       Deadlock       CIL Part - B
Question 66 Explanation: 

Question 67
Raymond’s tree based algorithm ensures
A
No starvation, but deadlock may occur in rare clases
B
No deadlock but starvation may occur
C
Neither deadlock nor starvation can occur
D
Deadlock may occur in cases where the process is already starved
       Operating-Systems       Deadlock       ISRO CS 2020
Question 67 Explanation: 
This algorithm creates a tree data structure and hence avoids a cycle. Therefore, deadlock is not possible. A site can enter the critical section on receiving the token even when its request is not on the top of the request queue. Hence, starvation is possible.
Question 68
An aid to determine the deadlock occurrence is
A
Resource allocation graph
B
Starvation graph
C
Inversion graph
D
None of the above
       Operating-Systems       Deadlock       ISRO CS 2020
Question 68 Explanation: 
Resource allocation graph (RAG) is a diagrammatic representation of processes and the resources in a system. Visually one can determine the occurrence of deadlock using RAG.
Question 69
Which of the following strategy is adopted to deal with deadlocks that have occurred in operating system?
A
prevention
B
avoidance
C
detection and recovery
D
ignore the problem
       Operating-Systems       Deadlock       APPSC-2016-DL-CS
Question 69 Explanation: 
Deadlock avoidance and prevention are the techniques used to deal with deadlock before it actually happens But deadlock detection and recovery is a technique used to deal with deadlocks that have already occured in the system.
Ignoring the problem is not a way to deal the deadlocks that have occurred
Question 70

Banker’s algorithm is used for _______ purpose.

A
deadlock avoidance
B
deadlock removal
C
deadlock prevention
D
deadlock continuations
       Operating-Systems       Deadlock       APPSC-2016-DL-CA
Question 70 Explanation: 
Banker’s algorithm is used for deadlock avoidance purpose.
Question 71

Which one from the following is a false statements about deadlock?

A
Memory is a non-preemptible resource.
B
Mutual exclusion condition is not possible for several resources under deadlock prevention
C
Recovery from deadlock is possible through rollback
D
If there is a cycle and there is single instance per resource type then there is a deadlock.
       Operating-Systems       Deadlock       APPSC-2012-DL CA
Question 71 Explanation: 
False,Memory is a preemptive resource.
True.
True.
True.
Question 72

Following are the conditions of deadlock
(I) Mutual exclusion
(II) Hold and Wait
(III) No preemption
(IV) Circular Wait
Which conditions from above are necessary conditions for deadlock?

A
Only (I), (II), and (III)
B
Only (II, (III) and (IV)
C
Only (I), (III) and (IV)
D
All (I), (II), (III) and (IV)
       Operating-Systems       Deadlock       APPSC-2012-DL CA
Question 72 Explanation: 
The four necessary conditions for deadlock are:
Mutual exclusion
Hold and wait
No preemption
Circular wait
Question 73
With a single resource, deadlock occurs
A
If there are more than two processes competing for that resource
B
If there are only two processes competing for that resource
C
If there is a single process competing for that resource
D
None of these
       Operating-Systems       Deadlock       TNPSC-2012-Polytechnic-CS
Question 73 Explanation: 
With a single resource deadlock can never occur. For a deadlock to occur atleast two resource should be there. Suppose that two resources are there and two processes are there then each process will acquire one resource and wait for the resources held by opposition process to complete and this way deadlock can occur.
There are 73 questions to complete.
PHP Code Snippets Powered By : XYZScripts.com
error: Content is protected !!