Deadlock


Q21.

A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units, then
GateOverflow

Q22.

With single resource, deadlock occurs
GateOverflow

Q23.

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 _________.
GateOverflow

Q24.

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?\begin{array}{lll} \text {Process } & \text {Used } & \text {Max } \\ P_{1} & 2 & 7 \\ P_{2} & 1 & 6 \\ P_{3} & 2 & 5 \\ P_{4} & 1 & 4 \end{array}
GateOverflow

Q25.

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?
GateOverflow

Q26.

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
GateOverflow

Q27.

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:
GateOverflow

Q28.

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. 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?
GateOverflow

Q29.

A system has n resources R_{0},...R_{n-1}, and k processes P_{0},...P_{k-1}. The implementation of the resource request logic of each process P_{i} is as follows: if (i%2= = 0) { if (i\ltn) request R_{i} ; if (i+2\ltn)request R_{i+2}; } else { if (i\ltn) request R_{n-i}; if (i+2\ltn)request R_{n-i-2} ; } In which one of the following situations is a deadlock possible?
GateOverflow

Q30.

What is the minimum number of resources required to ensure that deadlock will never occur, if there are currently three processes P_{1},P_{2} and P_{3} running in a system whose maximum demand for the resources of same type are 3, 4, and 5 respectively.
GateOverflow