Engr 664: Theory of Concurrent Programming
Spring Semester 2005

Assignment #3
Due Wednesday, 23 February 2005


This exercise may be done individually or in groups of two people.

Do one of the following:

You will be given instructions later on how to submit your programs.


Problem: Late Evening Study Session

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. Implement the above system as a Java program using Java threads and monitors.


UP to ENGR 664 assignments document?


Copyright © 2005, H. Conrad Cunningham
Last modified: Thu 10 Feb 2005