To Implement Deadlock Detection Algorithm

Post Test

1. Which strategy might be employed to resolve deadlocks detected by an operating system?

a) Avoidance by proactively managing resources.
b) Prevention by never allowing processes to request resources.
c) Resource preemption by forcibly releasing resources from processes.
d) Ignoring deadlocks and allowing processes to remain blocked indefinitely.

2. Consider a system which have ‘n’ number of processes and ‘m’ number of resource types. The time complexity of the safety algorithm, which checks whether a system is in safe state or not, is of the order of:

a) O(mn)
b) O(m2n2)
c) O(m2n)
d) O(mn2)

3. Which condition must be met for the Banker's Algorithm to grant a resource request?

a) The request must be less than or equal to the available resources
b) The request must be less than or equal to the process's maximum claim
c) The resulting state after allocation must be safe
d) All of the above

4. 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

a) 15
b) 9
c) 10
d) 11

5. In which situation will the Banker's Algorithm deny a resource request?

a) If the request is greater than the process's maximum claim
b) If the resources requested are not available
c) If granting the request would result in an unsafe state
d) If the system is overloaded with processes