Skip to content

Banker's Algorithm is designed to avoid deadlocks in systems where multiple processes request and hold resources.

Notifications You must be signed in to change notification settings

EPW80/Bankers_Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bankers Algorithm

Project Overview

Banker's Algorithm is designed to avoid deadlocks in systems where multiple processes request and hold resources. The algorithm functions like a bank loan system, where the operating system must selectively approve resource requests from processes to ensure all processes can run to completion without deadlocking.

Running the project

  • Ensure you have a C++ compiler installed (like g++).
  • Compile the program. For example, if the main file is main.cpp, use the following command:
sudo g++ -o bankers bankers.cpp semaphore_layer.c -lpthread
  • This will compile the program and create an executable named bankers.

Execution

Run the program using the command:

./bankers

Provide input as required by the program, either through stdin or by redirecting input from a file, e.g.:

./bankers < data/bankers_tiny.txt

data folder

Test the program with various provided data files (e.g., data/bankers_tinier.txt, data/bankers_tiny.txt, data/bankers_small.txt, etc.).

Demo

Contributor

Erik Williams

About

Banker's Algorithm is designed to avoid deadlocks in systems where multiple processes request and hold resources.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published