CSE 306 -- Operating Systems

Spring 2002

First OSP Programming Assignment: Thread Management


Out: 20 February 2002
Due: 6 March 2002, 5:30pm


In this assignment, you are to implement the Threads module of OSP2. The project files are available from http://www.cs.sunysb.edu/~cse306/Threads/ and extensive documentation on the Threads module can be found in the OSP manual.

Besides what is stated in the manual, the only additional requirement is that the dispatcher should schedule threads using the Highest Response Ratio Next (HRRN) strategy. Since we do not know the real next CPU burst of a thread, your scheduler should use the previous CPU burst of the thread. Newly created threads (which do not have a previous CPU burst) should receive the highest priority. Note that all this means that you must arrange to save the previous CPU burst of each thread when the thread gives up control of the CPU. Your objective in this project is to get your implementation to run under OSP2 without errors and warnings with the parameter file given in the Threads directory.

You should also strive to obtain good performance statistics during simulation, particularly those statistics related to CPU scheduling (average service time, average normalized service time, etc). How do you know if your statistic are good? One way is to compare your statistics with those obtained by runnning the OSP demo on the same OSP parameter file (the one distributed with the Threads assignment). Since the demo merely uses first-come-first-serve scheduling, your statistic should be at least as good as those of the demo.

Documentation

You do not need to hand in separate external documentation for your program, but you must include a comment section at the head of your ThreadCB.java source file that explains any and all of the design decisions you made in implementing the HRRN scheduling algorithm. You should also explain the statistics you are getting and compare them to the ones obtained by the demo version of OSP. Keep your comments brief but clear.

Your code is expected to be commented in a professional-looking manner and you are also expected to follow good programming practices. For example, you should use the try and catch exception-handling constructs of Java wherever appropriate.

Important Notice on the Use of CVS

As explained in the project description, you must use CVS to maintain your project files. We will check your CVS log to make sure that substantial activity has been taking place over a period of time. The advantage of CVS is that it is a very popular cross-patform version control tool that allows concurrent access by multiple users and, even more importantly, by remote users. In particular, you can be working on the project off-line on your home machine and will need to go on-line only when you need to update the project repository in the UG lab. By now you should have read the CVS manual (if not, you really have very little time). A very brief instruction set is given in the general information web page.

To enable us to check your CVS logs, you must allow us to log into your account using Secure Shell, or ssh. We do not need to know your password, but you must place certain files in your account and add some other files as explained in the general information web page. This will allow us to access your account, check logs, and run your project in a secure way. This does not expose your account to anybody else.

How to submit

When you are have finished the assignment, follow the instructions at the how to submit web page. Remember to include your name and user-id in the program source file. Do not submit hard copies. This project is to be done individually.

GOOD LUCK!


Scott Smolka
Wed Feb 20 11:20:11 EDT 2002