Dijkstra's Banker's algorithm in an operating system solves the problem of:
Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Dijkstra's Banker's algorithm in an operating system solves the problem of:
Show answer & explanation
Dijkstra's Banker's algorithm is a resource allocation and deadlock avoidance algorithm that prevents deadlock by ensuring the system never enters an unsafe state. It works by checking whether granting a resource request will leave the system in a safe state before allocation. Deadlock recovery (B) deals with detecting and breaking deadlocks after they occur; mutual exclusion (C) ensures only one process accesses a resource at a time; context switching (D) is CPU scheduling, unrelated to deadlock handling.
Step-by-step Derivation:
The Banker's algorithm operates on the principle of safe sequences and safe states:
- When a process requests resources, the algorithm simulates granting them.
- It then checks if there exists a safe sequence where all processes can complete.
- If a safe sequence exists, the request is granted (avoidance succeeds).
- If no safe sequence exists, the request is denied to avoid entering an unsafe state.
This is avoidance, not recovery—it prevents deadlock proactively rather than handling it after occurrence.