Deadlocks questions

Q29

GATE CS 2026 CS-1DeadlocksMSQ1 mark
With respect to deadlocks in an operating system, which of the following statements is/are FALSE?
More than one option can be correct.
Show answer without attempting

Answer: A, C

Q35

GATE CS 2026 CS-1DeadlocksNAT1 mark
Consider a system consisting of kk instances of a resource RR, being shared by 5 processes. Assume that each process requires a maximum of two instances of resource RR and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance.

The minimum value of kk for the system to be deadlock-free is ________. (answer in integer)
Show answer without attempting

Answer: 6

Q48

GATE CS 2025 CS-2DeadlocksMSQ2 marks
P={P1,P2,P3,P4}P = \{P_1, P_2, P_3, P_4\} consists of all active processes in an operating system.
R={R1,R2,R3,R4}R = \{R_1, R_2, R_3, R_4\} consists of single instances of distinct types of resources in the system.

The resource allocation graph has the following assignment and claim edges.

Assignment edges: R1→P1,R2→P2,R3→P3,R4→P4R_1 \rightarrow P_1, R_2 \rightarrow P_2, R_3 \rightarrow P_3, R_4 \rightarrow P_4 (the assignment edge R1→P1R_1 \rightarrow P_1 means resource R1R_1 is assigned to process P1P_1, and so on for others)
Claim edges: P1→R2,P2→R3,P3→R1,P2→R4,P4→R2P_1 \rightarrow R_2, P_2 \rightarrow R_3, P_3 \rightarrow R_1, P_2 \rightarrow R_4, P_4 \rightarrow R_2 (the claim edge P1→R2P_1 \rightarrow R_2 means process P1P_1 is waiting for resource R2R_2, and so on for others)

Which of the following statement(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: C, D

Q26

GATE CS 2022 CSDeadlocksMSQ1 mark
Which of the following statements is/are TRUE with respect to deadlocks?
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q43

GATE CS 2021 CS-2DeadlocksMSQ2 marks
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock (L). The following scheme is used to own a resource instance :
function OWNRESOURCE(Resource R)
    Acquire lock L // a global lock
    if R is available then
        Acquire R
        Release lock L
    else
        if R is owned by another process P then
            Terminate P, after releasing all resources owned by P
            Acquire R
            Restart P
            Release lock L
        end if
    end if
end function
Which of the following choice(s) about the above scheme is/are correct?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q39

GATE CS 2019 CSDeadlocksMCQ2 marks−2/3 if wrong
Consider the following snapshot of a system running nn concurrent processes. Process ii is holding XiX_i instances of a resource R, 1≤i≤n1 \le i \le n. Assume that all instances of R are currently in use. Further, for all ii, process ii can place a request for at most YiY_i additional instances of R while holding the XiX_i instances it already has. Of the nn processes, there are exactly two processes pp and qq such that Yp=Yq=0Y_p = Y_q = 0. Which one of the following conditions guarantees that no other process apart from pp and qq can complete execution?
Show answer without attempting

Answer: A

Q24

GATE CS 2018 CSDeadlocksNAT1 mark
Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of KK instances. Resource instances can be requested and released only one at a time. The largest value of KK that will always avoid deadlock is ____.
Show answer without attempting

Answer: 2

Q39

GATE CS 2018 CSDeadlocksMCQ2 marks−2/3 if wrong
In a system, there are three types of resources: E,FE, F and GG. Four processes P0,P1,P2P_0, P_1, P_2 and P3P_3 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]\text{Max}[P_2, F] is the maximum number of instances of FF that P2P_2 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 EE and 3 instances of FF are the only resources available.

Allocation:
EEFFGG
P0P_0101
P1P_1112
P2P_2103
P3P_3200
Max:
EEFFGG
P0P_0431
P1P_1214
P2P_2133
P3P_3541
From the perspective of deadlock avoidance, which one of the following is true?
Show answer without attempting

Answer: A

Q33

GATE CS 2017 CS-2DeadlocksMCQ2 marks−2/3 if wrong
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
ProcessCurrent AllocationMaximum Requirement
P137
P216
P335
Which of the following best describes current state of the system?
Show answer without attempting

Answer: B

Q45

GATE CS 2015 CS-3DeadlocksMCQ2 marks−2/3 if wrong
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?
Show answer without attempting

Answer: D

Q30

GATE CS 2015 CS-2DeadlocksMCQ1 mark−1/3 if wrong
A system has 6 identical resources and NN processes competing for them. Each process can request atmost 2 resources. Which one of the following values of NN could lead to a deadlock?
Show answer without attempting

Answer: D

Q31

GATE CS 2014 CS-3DeadlocksNAT2 marks
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 _________.
Show answer without attempting

Answer: 7

Q31

GATE CS 2014 CS-1DeadlocksMCQ2 marks−2/3 if wrong
An operating system uses the Banker's algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.
Allocation XAllocation YAllocation ZMax XMax YMax Z
P0001843
P1320620
P2211333
There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state. Consider the following independent requests for additional resources in the current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Which one of the following is TRUE?
Show answer without attempting

Answer: B

Q16

GATE CS 2013 CSDeadlocksMCQ1 mark−1/3 if wrong
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the PP operation (i.e., wait) on semaphores aa, bb and cc; process Y executes the PP operation on semaphores bb, cc and dd; process Z executes the PP operation on semaphores cc, dd, and aa before entering the respective code segments. After completing the execution of its code segment, each process invokes the VV operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock-free order of invoking the PP operations by the processes?
Show answer without attempting

Answer: B

0/140 correct0 marks

Related topics in Operating Systems