CS 3733 Operating Systems, Fall 2002 Assignment 2

Parts 0 and 1 Due Tuesday, October 1, 2002
Parts 2 and 3 Due Thursday, October 10, 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_00-b05)
Java HotSpot(TM) Client VM (build 1.4.0_00-b05, 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

Consider 20 processes all arriving at the same time, all with duration 1000. Ten of the processes have constant CPU bursts of 30. The other 10 have CPU bursts uniformly distributed between 100 and 200. Use the SJF scheduling algorithm. Perform an experiment with two runs, one in which all of the I/O bursts are 50 units and one in which they are all 500 units.

Create an HTML log containing tables of statistics, graphs, and Gantt charts to show the results of the two runs.

  1. Estimate the load average for each of the runs. The load average is defined as the average number of processes in the ready queue. This information is not directly available from the simulation statistics, but can be calculated using Little's Law which implies that the load average is the total waiting time divided by the time for the experiment.
  2. Do an analysis of the results of the experiment. What does this experiment show?
  3. If the units are in microseconds, which of these runs would be more like real processes? Why?


Part 3

Consider the two statements:

  1. If the context switch time is ignored, the average waiting time for RR with a given quantum will be close to that of FCFS when the quantum is large.
  2. If the context switch time is ignored, the average waiting time for RR with a given quantum will be close to that of SJF when the quantum is small.
For each of these statements:
  1. Explain why you think that the statement is true or false.
  2. Use the simulator to design an experiment that backs up your statement.
    1. Create and run the experiment. Hand in the log file containing tables and graphs that show your results.
    2. Explain to what extent your experiment proves that your explanation in a) is correct.


Handing in the assignment


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.