P1
P2
R3
P3
R2
P4
R1
ii) Assign a unit of R3 to P3 and another unit of R3 to P2.
P1
P2
R3
P3
R2
P4
R1
Good luck for your final examination!! –Zima167-
iii) P3 terminates and can produce more units of R2. Since P3 is the producer of R2, unit of R2 is infinity.
P1
P2
R3
P3
R2
P4
R1
iv) Now, a unit of R2 is assign to P2 and P4, so that both can terminate. Notice that two units of R2 are missing, this is because P2 and P3 consumes the resources.
P1
P2
R3
P3
R2
P4
R1
v) Lastly, all processes had received the resources needed, the graph is reducible. Thus, no deadlock.
P1
P2
R3
P3
R2
P4
R1
e) Describe TWO ways of preventing deadlock. (2m) - Preempt resource use numbering in circular wait Hold & wait (get all resources at once or release all resource before requesting) f) What is the difference between deadlock and starvation.(2m) - Endless vs indefinite waiting Good luck for your final examination!! –Zima167-
2. a) What is the difference (in terms of address) between relocatable object module and absolute program? (1m) - Relocatable object module