Banker’s algorithm for deadlock avoidance

$25.00

Category:

Description

Implement the Banker’s algorithm for deadlock avoidance, that works on a given set of N processes and M resource types (N<10,M<10). Use C for the implementation, with a simple text interface, where the user enters only the name of the input file (text only). The program reads all the necessary input data from that file.

The input data and result is then displayed on the screen.

Deliverables: the source code + a screenshot of the program showing an execution example.

IMPORTANT: The grading scale for this assignment is all follows:

– max score is 70% if you use a GREEDY approach (will find one solution, but not always).

– max score is 90% if you use BACKTRACKING and find one solution only

– max score is 100% if you use BACKTRACKING and find all solutions
7 Processes
5 Resources
Initial State Available: 4 5 0 1 1
Process Max Claim Allocation Need
p1 8 5 2 4 6 0 1 0 1 3 0 4 2 3 3
p2 8 7 0 2 9 1 0 0 0 1 7 7 0 2 8
p3 4 8 1 7 4 1 1 1 2 2 3 7 0 5 2
p4 7 3 2 2 3 0 0 0 1 1 7 3 2 1 2
p5 7 1 1 1 0 0 1 0 1 0 7 0 1 0 0
p6 5 5 1 0 2 0 0 1 0 1 5 5 0 0 1
p7 3 7 8 6 3 0 0 0 1 1 3 7 8 5 2

The needs are listed below: (each line is a different process)