Deadlock: GATE CS Previous Year Questions

Deadlock · Operating System

23 questions · asked in 17 of 27 years (2000–2026)

MCQ 17 · MSQ 3 · NAT 31-mark 11 · 2-mark 12

2000Questions per year2026

Questions 6–10 of 23

Q6GATE 20181 markNAT
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 ____.

Q7GATE 20182 marksMCQ−0.67 if wrong
In a system, there are three types of resources: E, F and G. Four processes P0,P1,P2  and  P3P_0,P_1,P_2 \; and \; P_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[P2P_2,F] is the maximum number of instances of F 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 E and 3 instances of F are the only resources available.
Allocation E F G P0 1 0 1 P1 1 1 2 P2 1 0 3 P3 2 0 0 Max E F G P0 4 3 1 P1 2 1 4 P2 1 3 3 P3 5 4 1
From the perspective of deadlock avoidance, which one of the following is true?

Q8GATE 2017 (Session 1)2 marksMCQ−0.67 if wrong
A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are:

Q9GATE 2017 (Session 2)2 marksMCQ−0.67 if wrong
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
Process Current Allocation Maximum Requirement P137 P216 P335
Which of the following best describes current state of the system ?

Q10GATE 2015 (Session 3)2 marksMCQ−0.67 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?

Keep practising

Topics in Operating System

All CS topics ›