This is a project that virtualizes the Banker's Algorithm studied in the Operating Systems course in Computer and Systems Engineering in Ain Shams University. Our textbook is Operating System Concepts 10th edition. This application was created using React framework.
https://xtratos.github.io/Bankers-Algorithm/
- I created this app while using node version 15.8.0 and npm version 7.5.1, other versions will most probably work but it's not guaranteed.
- clone the respository
- install node dependancies using
npm install
- run the applicated using
npm run start
On the first page there are 2 choices to start using the app
- To start a brand new state by specifying the number of resources in the system.
- By using a pre-saved state to restore it and use it.
- Add Process:
- Adds a new process to the existing system.
- Show Need Matrix:
- Shows the need matrix below the process matrix.
- Check System Safety
- Checks the system safety in the current state and provides a sequence of processes that creates a safe state.
- Check Request Safety
- Checks whether the system will be in a safe state after requesting some resources for a specific process.
- Note that you can also do the request manually by adding the requested resources to the allocated resources section and removing them from the available section.
- Save State:
- Provides a string which represents the current state of the system, this string can be used later to restore the current system state.
- Reset:
- Ditches the current state and resets the website to the initial state.
The output is always shown in a modal, the possible outcomes are
- Yes, Safe state
When the system is in a safe state - No
When the system is not in safe state
- Yes, the request can be granted with safe state, Safe state
When the request can be granted - No
When the request can't be granted seq is a sequence of operations which guarantees system safety, example for a sequence
<P0, P3, P2, P4, P1>
- Interactive UI.
- Ability to save and restore states using a state string.