https://github.com/mazensayed91/bankersalgorithm
https://github.com/mazensayed91/bankersalgorithm
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mazensayed91/bankersalgorithm
- Owner: Mazensayed91
- Created: 2021-05-20T11:13:40.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-04T19:57:26.000Z (about 5 years ago)
- Last Synced: 2025-04-04T08:47:31.874Z (over 1 year ago)
- Language: Python
- Size: 82.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BankersAlgorithm
The banker’s algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.
# How to use [Method 1]
- clone the repo
- run this command from the terminal or simply install numpy => "pip install -r requirements.txt"
- run this command from the terminal "python app.py"
-  : ex : "0 0 1 2,1 0 0 0,1 3 5 4,0 6 3 2,0 0 1 4"
-  : ex : "0 0 1 2,1 7 5 0,2 3 5 6,0 6 5 2,0 6 5 6"
-  : ex : "3 4 3 2"
- Then the need matrix will be printed and you will be asked if you want to know if the state is safe or not
- 
- if you clicked 1 : 
- Then you can click 1 again if you want to know if an immediate request could be granted
- first enter the process number : 
- Then the request : 
# How to use [Method 2]
Simply download app folder and run app.exe