Exercise problem 6.3 from the text (page 185) [20 points]
Exercise problem 6.4 from the text (pages 185-186) [20 points]
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]
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 |
- When x = 10, show that this is safe state. [5 points]
- What is the smallest value of x for which this is a safe state? Prove. [15 points]
Homework should be submitted via Blackboard as a single pdf file "hw2.pdf". Follow the link for Homework 2.