CS 3120 Operating Systems, Summer 2003
Assignment 6, due: Friday, July 25, 1:35 pm.
This assignment is to be typed with the exception of any diagrams, which can be neatly drawn.
A group of students are studying for an OS midterm. The students can study only while eating pizza. Each student repeatedly picks up a piece of pizza and then studies while eating the pizza. If a student finds that all the slices of the pizza are gone, the student goes to sleep until another pizza arrives. The first student to discover that the group is out of pizza phones Pizza Hut to order another pizza before eating the last piece. Each pizza has S slices. Write code to synchronize the student threads and the pizza delivery thread. Your solution should avoid deadlock and Pizza Delight should be phoned (i.e., wake up the delivery thread) exactly once each time a pizza is exhausted. No piece of pizza may be consumed by more than one student.
Frame # |
Process ID |
Page # |
0 |
1 |
2 |
1 |
1 |
1 |
2 |
2 |
1 |
3 |
3 |
0 |
4 |
1 |
3 |
a. To which physical address does logical address 175 of process 1 map? If this logical address does not map to any physical address, write "does not map".
b. To which physical address does logical address 38 of process 2 map? If this logical address does not map to any physical adddress, write "does not map".
c. Which logical address of which process maps to physical address 27.