TB

Banker's Algorithm

Deadlock avoidance in C, with an interactive resource-graph UI.

A team assignment for F.CSM302 Operating Systems at MUST: the Banker's Algorithm programming project from Silberschatz, Operating System Concepts (10th ed., ch. 8).

The C program grants a resource request only if the system stays in a safe state. A browser UI lets you edit Available, Max and Allocation, submit requests and step through the safety algorithm on a resource graph. The C binary does all the calculation.

Program

  • CLI : RQ / RL / * commands, safety algorithm (§8.6.3.1) and resource-request algorithm (§8.6.3.2).
  • Interactive UI : assignment, claim and request edges drawn as a resource graph.
  • Step-through : the safety algorithm shown one step at a time.
  • Tests : unit, CLI and server tests run with make test.
client
MUST · F.CSM302 Operating Systems
role
Team project (5 members)
period
2026
status
Submitted
stack
C11MakePythonJavaScript
fig. 02
Resource graph after a granted request
Resource graph after a granted request
fig. 03
Safety algorithm, step by step
Safety algorithm, step by step
fig. 04
Command console
Command console