UMBC CMSC421 UMBC | CSEE | CMSC421 | Spring 1999 (Section 0101)

 

Homework #2

CMSC 421, Section 0101 (Spring 1999)

Assigned: 3 March 1999
Due: 10 March 1999 at 3:30 PM

Late homeworks will not be accepted.

  1. Problem 6.7 from the text.
  2. Problem 6.8 from the text.
  3. Problem 6.14 from the text.
  4. Consider the following snapshot of a system:
    Process Allocation Max
    A B C D A B C D
    P0 0 0 1 2 0 0 1 2
    P1 1 0 0 0 1 7 5 0
    P2 1 3 5 4 2 3 5 6
    P3 0 0 1 4 0 6 5 6
    P4 0 6 3 2 0 6 5 2

    Currently, the available resources are: 1-A, 5-B, 2-C, 0-D. Answer the following questions, assuming you're using the banker's algorithm to manage resources and avoid deadlock:
    1. What is the content of the Need matrix?
    2. Is the system currently in a safe state?
    3. If process P1 requests an additional (0,4,2,0) resources, can this request be granted immediately?
  5. Problem 7.4 from the text.
  6. Problem 7.5 from the text.
  7. Most modern computer systems don't use the banker's algorithm or similar methods to avoid deadlock. Why not? Can a modern system deadlock over limited resources? If so, how are deadlocks usually resolved?
  8. Many applications use multiple threads interacting via shared locks, and individual threads often require multiple locks to accomplish their tasks. Propose a way to write code so that threads can't deadlock. How does this method prevent deadlock?


Syllabus | Slides | News & Notes | Grades | Feedback
How to Submit Assignments | Homework: 1 2 3 4 5 6 | Project: 1 2 3 4


Last updated 2 Mar 1999 by Ethan Miller (elm@csee.umbc.edu)