Do one of the following:
Do exercises 4.3 and 4.4 on page 78 of the textbook. This calls for you to develop an FSP model for a seat reservation system and implement it with a Java program using threads.
Do the Late Evening Study Session problem below. (This is essentially the same problem as exercise 5.4 on page 105 of the textbook.) This program calls for you to develop an FSP model and implement it as a Java program using threads and a monitor.
Submit your source code and documentation using BlackBoard.
A group of computer science graduate students is studying late one evening at a professor's house. The students are drinking iced tea from a large pitcher that holds several glasses of tea. The professor, who had stayed up late the night before preparing another one of his brilliant lectures, is napping in a chair.
When a student wants to drink, he or she fills a glass from the pitcher, unless it is empty. If the pitcher is empty, the student waits until the professor wakes up and refills the pitcher. The behaviors of the students and the professor are specified by the following FSP processes:
STUDENT = (fillglass -> study -> STUDENT).
PROFESSOR = (fillpitcher -> nap -> PROFESSOR).
Model the behavior of the PITCHER
as an FSP process and then implement it as a Java monitor.