Test: Deadlock- 1


9 Questions MCQ Test GATE Computer Science Engineering(CSE) 2022 Mock Test Series | Test: Deadlock- 1


Description
This mock test of Test: Deadlock- 1 for Computer Science Engineering (CSE) helps you for every Computer Science Engineering (CSE) entrance exam. This contains 9 Multiple Choice Questions for Computer Science Engineering (CSE) Test: Deadlock- 1 (mcq) to study with solutions a complete question bank. The solved questions answers in this Test: Deadlock- 1 quiz give you a good mix of easy questions and tough questions. Computer Science Engineering (CSE) students definitely take this Test: Deadlock- 1 exercise for a better result in the exam. You can find other Test: Deadlock- 1 extra questions, long questions & short questions for Computer Science Engineering (CSE) on EduRev as well by searching above.
QUESTION: 1

Dijkstra’s banking algorithm in an operating system performs

Solution:

Banker’s algorithm resources will only be allocated if system will remain in SAFE state (DEADLOCK can’t occur if system is in SAFE state), so performing DEADLOCK AVOIDANCE.

QUESTION: 2

Necessary conditions for deadlock are

Solution:

For deadlock four necessary condition are to be met
(i) Mutual exclusion
(ii) Non-preemption
(iii) Circular wait
(iv) Partial allocation [Bounded waiting]

QUESTION: 3

Which of the following statements is not true?

Solution:

Deadlock can’t take place if resources must be requested in same order by process. For deadlock, circular wait is a must condition.

QUESTION: 4

Suppose we have a system in which processes is in hold and wait condition then which of the following approach prevent the deadlock.

Solution:

To ensure that deadlock will not occur in a system in which processes are in HOLD and WAIT condition, a process requires to request all resources before it begins execution, or allow process to request resources only when the process has no other resources already allocated.

QUESTION: 5

What is a reusable resource? 

Solution:

Reusable resource: A resource, such as a CPU or tape transport, that is not rendered useless by being used. A magnetic disk or tape can be used often indefinitely and are to be regarded as reusable resources. Compare consumable resources.

QUESTION: 6

An operating system makes use of Banker’s algorithm to allocate 12 printers. Printers will be allocated to a process requesting them only if  there are enough available printers to allow it to run to completion.
User 1 using 7 printers and will need at most a total of 10 printers.
User 2 is using 1 printer and will need at most 4 printers.
User 3 is using 2 printers and will need at most 4 printers.
Each user is currently requesting 1 more printer, Which of the following is true?

Solution:

Total printers = 12
Printers allocated to user 1, user 2 and user 3 are 7, 1 and 2 respectively

So, only safest sequence is V3 first then either or V3. So, operating system will grant printer to user 3 only.

QUESTION: 7

A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid deadlock, which of the following is/are true
1. Deadlocked state is unsafe,
2. Unsafe state may lead to a deadlock situation.
3. Unsafe state must lead to a deadlock situation.
4. Deadlock state is a subset of unsafe state,

Solution:


(i) Deadlock is unsafe state
(ii) The unsafe state may lead to deadlock.
(iii) Clearly deadlock state is subset of unsafe state.
Its not compulsory that unsafe state always result in deadlock

QUESTION: 8

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

Solution:

Deadlock prevention scheme handles the dead lock by confirms that either of the four necessary condition for deadlock doesn’t occur. Hence a resource request may not be granted even if the resulting state is safe.

QUESTION: 9

An operating system implements a policy that requires a process to release all resources before making a request for another resource.

Solution:

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 properly yet. This will happen again when the process requests another resource. So, the process starves for proper utilisation of resources.

Deadlock will not occur as it is similar to a deadlock prevention scheme.

Similar Content

Related tests