Machine-translated by Google. Questions are authored in English.
Top

Deadlocks Questions and Answers

Direction for [ Question No: 1 To 1 ] :

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.

1.

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.

AllocationMax
EFGEFG
P0101431
P1112214
P2103133
P3200541

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

Exam Year(s)

GATE CS - 2018,

Answer: A

The system is in a safe state.

Need = Max − Allocation gives P0 (3, 3, 0), P1 (1, 0, 2), P2 (0, 3, 0) and P3 (3, 4, 1), with (3, 3, 0) available. The banker's safety check finds an order in which every process can finish:

  1. P0 needs (3, 3, 0), which is available. It finishes and releases (1, 0, 1): available becomes (4, 3, 1).
  2. P2 needs (0, 3, 0). It finishes and releases (1, 0, 3): available becomes (5, 3, 4).
  3. P1 needs (1, 0, 2). It finishes and releases (1, 1, 2): available becomes (6, 4, 6).
  4. P3 needs (3, 4, 1). It finishes.

The safe sequence P0, P2, P1, P3 exists, so the state is safe and none of the options claiming it is unsafe can be right, whichever extra resource they add.

Please log in or register to report this question.

Loading…
Tags: Deadlocks Questions and Answers || Deadlocks MCQ Questions and Answers || Deadlocks GK Questions and Answers || Deadlocks GK MCQ Questions || Deadlocks Multiple Choice Questions and Answers || Deadlocks GK || GK on Deadlocks || Operating Systems Questions and Answers || Operating Systems MCQ Questions and Answers || Operating Systems GK Questions and Answers || GK on Operating Systems