CSE 306 -- Operating Systems

Spring 2002

Third OSP Programming Assignment: Resources


Out: 3 April 2002
Due: 24 April 2002, 5:30pm


In this assignment, you are to implement the Resources module of OSP2. The project files are available from http://www.cs.sunysb.edu/~cse306/Resources/ and extensive documentation on the Resources module can be found in Chapter 8 off the OSP manual. In particular, you are to implement the Banker's algorithm for deadlock avoidance, but you are to heed the warning that appears in Chapter 8 of the OSP manual regarding resouce allocation and request matrix representations. See Chapter 6 of the course textbook by Stallings for a description of the Banker's algorithm, and attend the corresponding clas lectures.

The statistics of interest to the Resources module are ResourceAcquireCount and ResourceReleaseCount. You should track these statistic during simulation and make sure that they appear reasonable. Run the demo version of OSP distributed with this assignment to get an idea of what "reasonable" means. Your simulation should run to completion without warnings or errors, and resources should be granted to threads whenever the Banker's algorithm says they should.

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 ResourceCB.java source file that explains any and all of the design decisions you made in implementing the Resources module. 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

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 April 3 11:20:11 EDT 2002