-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Architecture of Simple Examples Assignments
To maintain the semantics of the examples, data structures that should be available to all parts of the program are put in the class GlobalProgramState as member variables declares as public and static. Further, this class contains the main function that starts the program. For example, see Producer/Consumer example.
In the examples, the default thread interface is hidden in the class AndrewsProcess that requires people to implement their multithreaded programs using the Runnable interface rather than extending the Thread class. The rationale is to force students to employ Runnable interface and to hide away details that are not addressed in the course.
Further, to simplify startup, a factory method andrewsProcessFactory that takes an array of RunnableSpecification starts the threads.