Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 1.09 KB

README.md

File metadata and controls

17 lines (16 loc) · 1.09 KB

Deadlock Detection Using Banker's Algorithm


This project implements a program in C++ that detects the possibility of a deadlock occurring for a set of incoming processes using the Banker's Algorithm. The program checks if the system is in a safe state or if a deadlock is possible, based on the resource allocation, maximum need, and available resources.

Banker's Algorithm


The Banker's Algorithm is a resource allocation and deadlock avoidance algorithm. It tests for safety by simulating the allocation of predetermined maximum possible amounts of resources and makes an "s-state" check to test for possible activities before deciding whether allocation should be allowed to continue.

How to Compile and Run

Prerequisites

A C++ compiler (e.g., g++, clang++)
A terminal or command prompt

Steps to Compile and Run

Save the code in a file named main.cpp.
Open a terminal or command prompt and navigate to the directory where the file is located.
Compile the code using a C++ compiler: