Task Performance Concurrency & Deadlocks
Task Performance Concurrency & Deadlocks
Path 2: Q obtains B before obtaining A. Following a request for A, P executes and stops. Q
discharges B and A. P will be able to acquire both resources when it restarts execution.
Path 3: Q gains B, and subsequently P gains A. Deadlock is unavoidable because as far as the
Path 4: P obtains A, followed by Q obtaining B. Because
Path 5: P acquires A and then B as it is being executed, deadlock is unavoidable. A request for B
is handled by Q, who then delays. P frees up A and B. Q will not be able to obtain both
resources when it restarts execution.
Path 6: P purchases A, then B, and finally both A and B. when Q begins to run again.
5. Do Execution Paths 3 and 4 encompass the first three conditions for a deadlock to occur?
Explain your answer.
The gray-shaded area in the figure above refers to the commentary on paths 3 and 4. If an
execution path enters this fatal region, then deadlock is inevitable. Deadlock is only inevitable if
the joint progress of the two processes creates a path that enters the fatal region.
6. If you are to implement deadlock prevention before the processes above reach the critical
section, would it be an indirect method or a direct method? Why?
Systems are created to guarantee that at least one of the four prerequisites for deadlock is
disregarded. Defined as an unresolved cyclic wait, deadlock is something that is best avoided
directly. Although the first three conditions must be met, they are insufficient to prevent a
simple impasse.
7. Which deadlock avoidance approach would you suggest for the given situation above and
why?
I advise using the Resource Allocation Denial, which refuses to grant a process an incremental
resource request if it might cause a deadlock. In order to prevent reaching the deadlock point,
this technique provides for the three conditions that must exist for a stalemate to occur. In
comparison to avoidance detection, it supports more concurrent operations.
8. Would you agree that deadlock is relative to the number of processes and available
resources in an operating system? Why or why not?
When a group of processes becomes stuck while one is holding onto a resource and another is
awaiting its acquisition by another process, it is said to be in a deadlock. The system is
considered to be in a deadlock when a process cannot modify its state indefinitely because the
resources it needs are being used by another waiting process.
9. If you are asked to reconstruct the progress diagram above to eliminate the critical section,
which is the deadlock-inevitable region, which aspect(s) or area(s) would you modify? Explain
how the modification eliminates the deadlock.
Contrary to the first diagram, get A and get B then release A release B means changing the
desired resource. Get A and get B then release A release B. The impasse can be resolved by
taking away a resource that is impeding the movement of resources via paths 3 and 4.