{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW4_Solutions - CS 4375 HOMEWORK#4 1 List and describe in...

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
a.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern