The computing system is an environment where multiple programs need to make use of alimited set of resources offered by the system, and processes may have to compete forresources. This competition may lead to a deadlock in the system, where each process is heldup in a cycle of waiting for other resources to be released by other processes. All processesare unable to proceed further. This will cause a serious problem to the system. Therefore, thesystem 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 thisalgorithm, 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 asystem 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.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here