CS 3733 Operating Systems, Spring 2002 Assignment 2

Parts 0 and 1 Due Tuesday, February 19, 2002
Parts 2 and 3 Due Tuesday, February 26, 2002


In this assignment you will explore the topic of CPU scheduling by using the scheduling simulator described in class. You can find out more about the simulator at the web site: /nsf/ps/index.html.
A copy of the simulator user's guide can be found at /nsf/ps/ps_doc/psdoc.html.
These links are also available from the course simulator web page.

You might want to read about the experiences students had with the simulator in a previous semester in a paper available at /nsf/pubs/process.html.


Part 0

In this part you will run the simulator remotely and create a remote log file.


Part 1

If you have not already done so, create a web page for yourself.
The address of your web page should be http://www.cs.utsa.edu/~username. Create a course web page with web address http://www.cs.utsa.edu/~username/cs3733/index.html. This should be globally accessible. Your course web page should be very simple without much graphics so that it will load quickly over a phone line.

Make a cs3733/assign2/part1, directory under your public_html directory. The permissions of the public_html, cs3733, assign2, and part1 directories should be drwxr-xr-x.

Make a directory somewhere in your account for this assignment called assign2. Do not put this under public_html. The permissions of this directory should be set so that only you have access to it. Make a subdirectory called part1. Copy all of the files from /usr/local/courses/java/psfiles/ into your part1 directory. Edit the psconfig file and change my name to yours. Make sure that your path includes /usr/local/courses/java/bin. Execute:
java -version
You should get output that looks like this:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
Java HotSpot(TM) Client VM (build 1.4.0-rc-b91, mixed mode)
Run the simulator using runps which is a script in this directory.

Run the simulator in the same way you did for Part 0. This will create a log file in your part1 directory along with three GIF files.

Copy these files into your assign2/part1 directory under your public_html. Set the permissions so that they are all world readable. Put a link to the log file in your course web page. Make sure you (and others) can access this log file through your link. Print out the log file and turn it in.

When you have completed Parts 0 and 1 of this assignment, send me email with the subject CS 3733 Assignment 2, Parts 0 and 1 complete.


Part 2

Make a part2 subdirectory of your assign2 directory for this part. Start by copying all of your files from part1 into this directory. Modify the files (and possibly create others) to perform the following experiment.

There will be 30 processes. All of the processes will arrive at time 0. They will have constant duration 500, have CPU bursts uniformly distributed between 10 and 100, have I/O bursts uniformly distributed between 100 and 1000.

Compare the following algorithms using these processes:

Produce a log file with the tabular data, Gantt charts, and a graph of waiting times.

Discuss the statistics and graphs. Which of these gives the most insight into what is happening? Explain why or why not the size of the quantum affects the average waiting time in this example. What happens when the quantum is very large? Don't just quote the numbers, but try to understand why the quantum affects the results as it does.


Part 3

Make a part3 subdirectory of your assign2 directory for this part. Think about the conditions under which PSJF will perform significantly better than SJF in average waiting time. Design an experiment to illustrate this. You must have at least 20 processes, each with more than one CPU burst. Try to get as large a ratio as possible for the average waiting times for SJF to PSJF. For SJF the average waiting time must be a significant fraction of the the running time.

As before, create a log file with tables and graphs to show what happened in your experiment. Include two short paragraphs at the end of the log file. In the first paragraph, explain in general the conditions under which PSJF performs better than SJF. In the second paragraph, explain why PSJF performs better than SJF in your experiment.


If you have a machine at home with Java installed, you can run the simulator at home by downloading the simulator code. Click here for more details.