Conditions that the deadlock occurs - Mutual exclusion, Hold and wait, No preemption, Circular wait.

Q.  What are the necessary conditions to occur the deadlock?
- Published on 22 Jun 15

a. Sharable resource, Hold and wait, Preemption, Circular wait.
b. Mutual exclusion, Hold and wait, No preemption, Circular wait.
c. Mutual exclusion, Hold and wait, Preemption, Circular wait.
d. None of the above.

ANSWER: Mutual exclusion, Hold and wait, No preemption, Circular wait.
 

    Discussion

  • Nirja Shah   -Posted on 25 Nov 15
    - The following are the deadlock conditions:

    1. Mutual exclusion
    - The resources involved must be unshareable; otherwise, the processes would not be prevented from using the resource when necessary.

    2. Hold and wait or partial allocation
    - The processes must hold the resources they have already been allocated while waiting for other (requested) resources. If the process had to release its resources when a new resource or resources were requested, deadlock could not occur because the process would not prevent others from using resources that it controlled.

    3. No pre-emption
    - The processes must not have resources taken away while that resource is being used. Otherwise, deadlock could not occur since the operating system could simply take enough resources from running processes to enable any process to finish.

    4. Resource waiting or circular wait
    - A circular chain of processes, with each process holding resources which are currently being requested by the next process in the chain, cannot exist. If it does, the cycle theorem (which states that "a cycle in the resource graph is necessary for deadlock to occur") indicated that deadlock could occur.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)