HW4_Solutions - CS 4375 HOMEWORK#4 1 List and describe in your own words the four conditions that must be satisfied for deadlock to occur Solution

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 4375: HOMEWORK #4 1. List and describe in your own words the four conditions that must be satisfied for deadlock to occur. Solution: mutual exclusion, wait and hold, no preemption, circular wait. 2. There are four conditions that must be satisfied for deadlock to occur. Discuss what happens if we remove any of them. Solution: Remove mutual exclusion condition: multiple processes have the same resource, which causes a lot of problems, so it is impossible to remove the mutual exclusion. Remove hold and wait condition: no parallelization will be allowed and many processes will be just checking for resources but maybe never get to run. Remove no preemption condition: it is impossible to remove it in some instances. For example, we do not want to stop burning a CD in the middle of the task. Remove circular chain of requests: if there is no circular chain of requests, then some process can run, which might allow another process to run, etc., so there is no deadlock. 3. There are four strategies to deal with deadlocks. One of these strategies is to ignore the possibility of deadlocking. Among the remaining three strategies, select one that you prefer and explain how you would implement it. Solution: The three strategies are: detect and recovery, avoid deadlocks by careful resource allocation, and prevent deadlocks by negating a necessary condition. 4. Consider the following snapshot of a system. There are no current unsatisfied requests. Available resources R1 R2 R3 R4 2 1 0 0 Processes allocations Current allocation Maximum allocation Still needs Process R1 R2 R3 R4 R1 R2 R3 R4 R1 R2 R3 R4 P1 0 0 1 2 0 0 1 2 0 0 0 0 P2 2 0 0 0 2 7 5 0 0 7 5 0 P3 0 0 3 4 6 6 5 6 6 6 2 2 P4 2 3 5 4 4 3 5 6 2 0 0 2 P5 0 3 3 2 0 6 5 2 0 3 2 0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
a. Is this system currently in a safe or unsafe state? Why?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/18/2012 for the course INFORMATIK 2011 taught by Professor Phanthuongcang during the Winter '11 term at Cornell University (Engineering School).

Page1 / 3

HW4_Solutions - CS 4375 HOMEWORK#4 1 List and describe in your own words the four conditions that must be satisfied for deadlock to occur Solution

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online