Design of a deadlock avoidance simulator using Banker\'s algorithm in C. Design
ID: 3557651 • Letter: D
Question
Design of a deadlock avoidance simulator using Banker's algorithm in C.
Design of a deadlock avoidance simulator using Banker's algorithm Evaluation Criteria Use of queues Use of process control block Use of Banker's algorithm to establish process execution order. Clear Code with documentation and Comments Management of multiple random scenarios Requirements Program should ask for amount of processes, and for each process, the total amount of resources required. Each Process should require a different amount of resources with no maximum. Reference (PID) to each process should be used in the queues. Amount of resources available for all the processes should be greater than 10 and can be changed in the code by the use of macro. Program should store the process context in a process control block. Program should evaluate the order of execution of the processes Programs should move from the ready queue, to the processor, and consume one resource, then evaluate if resources are still available to keep executing current process or pick another process. Then repeat until completion. Program should be able to show the matrix status at any moment. Process resource consumption may trigger upon pressing a designated key, which can be changed in the code by the use of macro or any other mechanism.Explanation / Answer
#include #include #include void main() { int allocation[10][5],max[10][5],need[10][5],available[3],flag[10],sq[10]; int n,r,i,j,k,count,count1=0; clrscr(); printf(" Input the number of processes running (Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.