CSE 451

Introduction to Operating Systems

Spring 1999


Program 1   Concurrency and Java Warm-Up

Due: Wednesday, April 28, 10:20 A.M.(in class or email)
 

The goals of this program are to learn some Java, to practice designing and using threads and monitors, and to build some basic operating systems functions and data structures.

Your program should have three threads, named Reader, Writer, and Reader_Writer, and two monitors, RW_Manager and Binary_Sem.  The threads access a common ready list RL that is controlled by the RW_Manager.  RL is a queue of process nodes, where each node contains a process name (a string of length less than 8 characters) and a time field. Implement RL as a doubly-linked list. The RL header should store the length of the list and an integer np giving the number of processors (Imagine RL as the ready list for a multiprocessor system).

The threads perform the following functions:

Use the sleep()  method of the Thread class in each of your threads in order to consume time.
 
The monitors have the following behaviors:


Turn in a copy of your program and traces of several test runs that illustrate all of the required and interesting features of your program. Also give a brief discussion and evaluation of your results.

Grading will be based on program style, correctness, efficiency, documentation, test case selection, and any interesting insights that you can offer on your design and results.  For example, can you deduce the thread scheduling policy underlying your Java system?  What happens as the sleep() parameter varies from zero upwards in each thread?  Can you starve the writers?



cse451-webmaster@cs.washington.edu