Ask Question
24 November, 09:08

The four conditions (mutual exclusion, hold and wait, no preemption and circular wait) are necessary for a resource deadlock to occur. Give an example to show that these conditions are not sufficient for a resource deadlock to occur. When are these conditions sufficient for a resource deadlock to occur

+3
Answers (1)
  1. 24 November, 09:23
    0
    The conditions sufficient for a resource deadlock to occur is when a deadlock will prevail for process A, B, and C when two resources R and S; if only one instance of each resources is allowed.

    Solution

    Deadlock conditions

    A deadlock is a situation where two or more processes request for same critical resource at the same time.

    The mutual exclusion applies a restriction to a resource when the resource is used by any process, it should become unavailable for the other resources

    The hold and wait allocations explains that any process which is allocate resources must hold them; till all needed resources are nor sure.

    In the meantime, if any other processes need a resource which is held by another process, then the latter will release the resource to prevent deadlock.

    No pre-emption states that the operating system can grant access to resources to another process while it is in use by another process; depending on the priority, to prevent deadlock.

    Circular wait should not be implemented so that resources being requested by process are allocated when they get free.

    Now,

    Three processes A, B, and C functions on a system, having two distinct resources R and S.

    The resource R has one instant active while resource S has two instances available.

    The instance of R is allocated to a process A after request. first instance of resource S is allocated to process B, and second instance of resource S is allocated to process C.

    When a request is placed by process B for resource R, then the resource is not available for execution. the process A request for resource S which is used by both C and B.

    All the four conditions prevail in this situation; yet deadlock does not occur.

    The resource S is released by process C and is allocated to process A. when process A finishes, it releases resources and resources R is allocate d to process B.

    Hence all three processes end without a deadlock.

    However, the deadlock will prevail for process A, B, and C when two resources R and S; if only one instance of each resources is allowed.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The four conditions (mutual exclusion, hold and wait, no preemption and circular wait) are necessary for a resource deadlock to occur. Give ...” in 📙 Business if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers