Question: / / 1 7 marks ( 2 + 3 + 3 + 3 + 3 + 3 ) a . Please list all the pre

//17 marks (2+3+3+3+3+3)
a. Please list all the pre-conditions for a deadlock to occur (general conceptual question, please
do not answer it based on the following parts of this question, you may use them as an
example though).
You are given 4 tasks - A,B,C and D and 3 resources x,y and z and their resource usage/ sharing.
Given - A,B,C and D have the same priority, they can request the resources in any order and
cannot relinquish a resource till finished with the use.
b. Can the above situation lead to a deadlock? Please explain your answer based on the
preconditions in part a.
c. Now in addition to all above details, c also needs to use resource x. Can this situation lead to
a deadlock ? Please explain your answer based on the preconditions in part a, i.e. what
changed or did not change enough to cause or avoid a deadlock.
d. Now consider the situation in part c. But now it is given that the tasks may request any
combination of resources but must do so in order i.e.x before y before z. Can this situation
lead to a deadlock ? Please explain your answer based on the preconditions in part a, i.e.
what changed or did not change enough to cause or avoid a deadlock. Can you give one
reason why you think this (enforcing ordering of requests) is a good design choice or not ?
e. Now consider the situation in part c. But now the tasks have different priorities i.e.A=1,B=
2,C=3,D=4(Lower number = higher priority) and scheduling is priority based preemptive.
We use priority inheritance to avoid priority inversion. Can it cause a deadlock ? Please
explain your answer based on the preconditions in part a, i.e. what changed or did not change
enough to cause or avoid a deadlock.
f. Why do you think might it be a good or bad idea to solve a deadlock after it happens by
making a process relinquish an acquired resource that is part of the deadlock? How does the
priority ceiling protocol fare in this aspect?
/ / 1 7 marks ( 2 + 3 + 3 + 3 + 3 + 3 ) a .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!