The computing system is an environment where multiple programs need to make use of a limited set of resources offered by the system, and processes may have to compete for resources. This competition...


The computing system is an environment where multiple programs need to make use of a
limited set of resources offered by the system, and processes may have to compete for
resources. This competition may lead to a deadlock in the system, where each process is held
up in a cycle of waiting for other resources to be released by other processes. All processes
are unable to proceed further. This will cause a serious problem to the system. Therefore, the
system needs to resolve deadlocks or prevent processes from entering a deadlock.
One of the schemes of avoiding a deadlock is known as the Banker’s Algorithm. In this
algorithm, all resource allocations are simulated and tested to determine whether an allocation pattern will possibly cause a deadlock.


create the program based on Banker’s algorithm to test a
system for deadlocks and try to allocate resources to process then detect again whether the allocation will cause deadlocks with the current resources available and the needs of all the process


Resources and process needs are represented as the four arrays below:
1. Available. Resource types and number of instances in each type. Single dimension.
2. Max. Maximum resource needed by each process. 2-dimension.
3. Allocation. Number of resources currently held by process. 2-dimension.
4. Need. Remaining resources still needed by process. 2-dimension.




Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here