Dijkstra’s banking algorithm in an operating system performs
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.
Necessary conditions for deadlock are
For deadlock four necessary condition are to be met
(i) Mutual exclusion
(iii) Circular wait
(iv) Partial allocation [Bounded waiting]
Which of the following statements is not true?
Deadlock can’t take place if resources must be requested in same order by process. For deadlock, circular wait is a must condition.
Suppose we have a system in which processes is in hold and wait condition then which of the following approach prevent the deadlock.
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.
What is a reusable resource?
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.
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?
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.
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,
(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
Which of the following is NOT true of deadlock prevention and deadlock avoidance schemes?
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.
An operating system implements a policy that requires a process to release all resources before making a request for another resource.
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.