{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

InClassActivity22-sol

# InClassActivity22-sol - Activity#22(Solution 1:42 PM...

This preview shows pages 1–2. Sign up to view the full content.

ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2003 Page 1 of 4 Activity #22 (Solution) 4/16/2003 1:42 PM Activity 22.1 Process synchronization. 1. (20 points) A restaurant serves all-you-can-eat type of open-buffet lunch. Customers can have any food they want with the restriction that only one person can take use the buffet at a time. While one customer is using the buffet, the others have to wait at a queue. Every customer has to obey FIFO rule for the queue, i.e. must join to tail of the queue. Consider two persons A and B arriving at the buffet. Fill in the following table to build a complete analogy by writing the analogous item on the right column. The first row is filled in for you as an example. Item described in textbook Persons A and B at the open-buffet analogy Mutual Exclusion Only one person can use the buffet at any point in time. Progress Requirement Only those people who are at the buffet and desiring to eat can participate on the decision as to who uses the buffet next. In other words, people who are far away, sitting on their tables and having fun have nothing to say in who gets the food next. Bounded Waiting After a person shows up at the buffet, there is an upper bound on the number of times that the other people can eat before the person can eat. This is enforced by the FIFO ruling of the buffet queue. Otherwise, some customers will have some food, eat it and come back for another. If there is not bounded waiting, then those guys who are not quick enough will starve.. And, the restaurant will not serve its purpose! What goes wrong with Algorithm #1 (describe the situation that causes a problem) Person B is at the buffet queue, and the buffet is not in use. Yet, person B can't get the food from the buffet, just because Person A hasn't had his turn yet.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}