OA. free
Free
Qualcomm Embedded Systems & Hardware Embedded Systems & Hardware Medium

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:

Choose one option.
Show answer & explanation
Answer: A. Deadlock avoidance

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:

  1. When a process requests resources, the algorithm simulates granting them.
  2. It then checks if there exists a safe sequence where all processes can complete.
  3. If a safe sequence exists, the request is granted (avoidance succeeds).
  4. 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.