CMSC 421, Principles of Operating Systems. Fall 2004
Computer Science & Electrical Engineering Department
University of Maryland Baltimore County


Homework 2.

Due by 11:59pm EST on Oct 26, 2004.

[80 Points]

  1. Exercise problem 6.3 from the text (page 185) [20 points]

  2. Exercise problem 6.4 from the text (pages 185-186) [20 points]

  3. Moonbucks coffee shop serves two kinds of coffee: hot-coffee and cold-coffee. Mr. Moon who makes coffee serves only one customer at a time and remaining customers will have to wait. When there are no customers, Mr. Moon sleeps. After serving a hot-coffee-customer, a cold-coffee customer gets served next only if there is no hot-coffee customer waiting. Similarly after serving a cold-coffee customer, a hot-coffee customer gets served only if there is no cold-coffee customer waiting. If Mr. Moon is asleep, the customer wakes him up. Write a monitor to coordinate Mr. Moon, the hot-coffee customers and the cold-coffee customers. [20 points]

  4. Consider the following snap shot of a system
    Process   Allocation   Maximum   Available
    P0 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1
    P1 2 0 1 1 1 2 2 2 1 1
    P2 1 1 0 1 0 2 1 3 1 0
    P3 1 1 1 1 0 1 1 2 2 1
  1. When x = 10, show that this is safe state. [5 points] 
  2. What is the smallest value of x for which this is a safe state? Prove. [15 points]

What to submit

Homework should be submitted via Blackboard as a single pdf file "hw2.pdf". Follow the link for Homework 2.