Which deadlock-avoidance algorithm is used when each resource type can have…

2018

Which deadlock-avoidance algorithm is used when each resource type can have multiple instances?

Answer: B. Banker's algorithmConceptDeadlock avoidance grants a resource request only if the resulting allocation remains in a safe state. A safe state has some order in which every…

  1. A.

    Resource-allocation graph

  2. B.

    Banker's algorithm

  3. C.

    Wait-for graph

  4. D.

    Semaphores

Attempted by 599 students.

Show answer & explanation

Correct answer: B

Concept

Deadlock avoidance grants a resource request only if the resulting allocation remains in a safe state.

A safe state has some order in which every process can obtain its remaining maximum need, complete, and release its resources. The suitable method depends on whether each resource type has one instance or several.

Application

Here the intended case has multiple instances of each resource type. The Banker’s algorithm represents Available, Allocation, Max, and Need counts and tentatively tests a request before committing it. The saved value is therefore the Banker’s algorithm.

Contrast

  • Resource-allocation graph: represents process-resource request and assignment edges; its cycle-based avoidance model normally assumes one instance of each resource type.

  • Banker’s algorithm: works with resource-count vectors and searches for a safe completion sequence before granting a request.

  • Wait-for graph: collapses dependencies to process-to-process edges and is used for cycle-based deadlock detection under the single-instance model.

  • Semaphores: coordinate access through wait and signal operations; they do not themselves perform the safe-sequence test used by a deadlock-avoidance algorithm.

Cross-check

With several copies of a resource type, a graph cycle alone does not prove deadlock; the available and remaining-need counts must be evaluated. This is the count-based safety test performed by the Banker’s algorithm.

Result

Banker’s algorithm.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs

Loading lesson…