Starting from:
$30

$24

Operating Systems HW5 SOlution

Points: 80

Questions 2 - 4: 15 points each

Question 1: 35 points




Note: Question 1 is a programming question which can be implemented in any programming language.




Submit a single zipped file containing the following two files:

The Source code, and



A text file containing screenshots for the output, and answers to questions 2 -4.






Implement Banker’s algorithm which will determine whether the state of the system is safe or unsafe.



[Consider the following input, Chap 7 – Deadlocks, page 332, 9/E]]




Resource type A has 10 instances, resource type B has 5 instances, and resource type C has 7 instances.




Suppose now that process P1 requests one additional instance of resource type A and two instances of resource type C. Show whether this request can be immediately granted.






Allocation
Max
Available


A B C
A B C
A B C
P0
0 1 0
7 5 3
3 3 2
P1
2 0 0
3 2 2


P2
3 0 2
9 0 2


P3
2 1 1
2 2 2


P4
0 0 2
4 3 3








Consider the following snapshot of a system:



Allocation
Max
Available
ABCD
ABCD
ABCD
2101
4212
3321
3121
5252


2113
2316


1312
1424


1432
3665





Answer the following questions using the Banker’s algorithm [Show all the work]




Illustrate that the system is in a safe state by demonstrating an order in which the processes may complete.



b. If a request from process arrives for (0, 0, 1, 0), can the request be granted immediately?

Consider the following snapshot of a system:



Allocation
Max
Available
ABCD
ABCD
ABCD
0012
0012
1520
1000
1750


1354
2356


0632
0652


0014
0656





Answer the following questions using the banker’s algorithm. [Show all the work]




What is the content of the matrix Need?



Is the system in a safe state?
If a request from process P1 arrives for (0, 4, 2, 0), can the request be granted immediately?






A system has 4 processes and 5 allocatable resource. The current allocation and maximum needs are as follows:



Allocated
Max
Available
10211
11212
0 0 x 1 1
20110
22210


11010
21310


11110
11221





What is the smallest value of x for which this is a safe state.

Also, give the order in which these can finish with this value of x.




[Show all the work]

More products