Homework 07: Chapter 07 Questions


Due: Thursday, March 1th by 5:59 PM
Assignment ID: hwk07

Header

Please put the following at the top of a flat text file, hwk07.txt:

Homework Questions

Write the answers to the following questions in hwk07.txt:
  1. Is it possible to have a deadlock involving only a single process? Explain.
  2. Exercise 7.11
  3. Given the following resource allocation graph:

    is this system in an unsafe state? If so, what is at least one thing that could be changed to make it be in a safe state? If not, what event(s) would be necessary for it to be in an unsafe state?
  4. What are the two main questions to be addressed when determining how often a detection algorithm should be run?
  5. Once deadlock has be detected, explain what possible remedies exist and the consequences of each.
  6. In a real computer system, neither the resources available nor the demands of processes for resources are consistent over long periods (months). Resources break or are replaced, new processes come and go, new resources are bought and added to the system. If deadlock is controlled by the banker's algorithm, which of the following changes can be made safely (without introducing the possibility of deadlock), and under what circumstances?
    1. Increase Available (new resources added)
    2. Decrease Available (resource permanently removed from system)
    3. Increase Max for one process (the process needs more resources than allowed, it may want more)
    4. Decrease Max for one process (the process decides it does not need that many resources)
    5. Increase the number of processes
    6. Decrease the number of processes
  7. Consider the following snapshot of a system:
        Allocation  Max   Need  Available
        ABCD        ABCD  ABCD  ABCD
    P0  0012        0012        1520
    P1  1000        1750
    P2  1354        2356
    P3  0632        0652
    P4  0014        0656
    
    Answer the following questions using the banker's algorithm:
    1. What is the content of the matrix Need?
    2. Is the system in a safe state?
    3. If a request from process P1 arrives for (0,4,2,0), can the request be granted immediately?

    Submission

    Submit hwk07.txt using the handin program. For example, for this homework, type the following in a terminal exactly as it appears:
      handin  hwk07  hwk07.txt
    

    Alternatively, you can submit the assignment from any computer via PeerSpace. After successfully logging into PeerSpace, go to Tools, then Assignments. Click on the Submit link.