11. Consider the following snapshot of a system with five processes(p1,...p5) an
ID: 3726832 • Letter: 1
Question
11. Consider the following snapshot of a system with five processes(p1,...p5) and four resources (r1,...r4). There are no current outstanding queued unsatisfied requests.
currently available resources
a. Compute what each process still might request and fill in the "still needs" columns. b. Is this system currently deadlocked, or will any process become deadlocked? Why or why not? If not, give an execution order c. If a request from p3 arrives for (0,1,0,0), can that request be safely granted immediately? In what state (deadlocked, safe, unsafe) would immediately granting the whole request leave the system? Which processes, if any, are or may become deadlocked if this whole request is granted immediately?
Explanation / Answer
b)
P1 executes first as still needs = <0 0 0 0> , work = available + current allocation = <2 1 0 0> + <0 0 1 2>
= <2 1 1 2>
P4 executes , work = available + current allocation = <2 1 1 2> + <2 3 5 4> = <4 4 6 6>
P5 executes , work = available + current allocation = <4 4 6 6> + <0 3 3 2> = <4 7 9 8>
P2 executes , work = available + current allocation = <4 7 9 8> + <2 0 0 0> = <6 7 9 8>
P3 executes , work = available + current allocation = <6 7 9 8> + <0 0 3 4> = <6 7 12 12 >
execution order = <p1,p4,p5,p2,p3>
The system is not in deadlock state.
c.
The request from p3 arrives for (0,1,0,0), can be safely granted immediately and the system will still be in safe state.
process current allocation max demand a)still needs = max demand - current allocation <r1 r2 r3 r4> <r1 r2 r3 r4> <r1 r2 r3 r4> p1 <0 0 1 2> < 0 0 1 2> <0 0 0 0> p2 <2 0 0 0> <2 7 5 0> <0 7 5 0> p3 <0 0 3 4> <6 6 5 6> <6 6 2 2> p4 <2 3 5 4> <4 3 5 6> <2 0 0 2> p5 <0 3 3 2> <0 6 5 2> <0 3 2 0>Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.