CS 3733 Operating Systems, Fall 2001 Assignment 2

Parts 0 and 1 Due Wednesday, October 3, 2001
Parts 2 and 3 Due Wednesday, October 10, 2001


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.

Look for the link Run the simulator remotely with log placed on vip on the course simulator web page. Use this link to run the simulator.

Click on the Open Log button. You will be prompted to enter your username. Enter the name you use to log into our Sun network.

Click Open Log again and the button should change to Close Log.

Click on Run Experiment and then Log All Table Data.

Click on Draw Graph and then the Log button on the graph. It may take a few seconds while the graph is converted into a GIF and then sent over the network.

Click on Draw Gantt Chart and choose the first one.

Adjust the size so that the entire chart is shown. You can use the Controls to change the height of the bars.

Click on the Log button on the Gantt chart.

Do the same for the second Gantt chart.

Close the log file and then click on Show Remote Log.

If all went well, the log file should pop up in a new browser window.

Print out the log file and hand it in.

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 version "1.2.2"
Solaris VM (build Solaris_JDK_1.2.2_07, native threads, sunwjit)

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 subdirectory of assign2 called part2. Again copy all of the files from /usr/local/courses/java/psfiles/ into your part2 directory. Edit the psconfig file and change my name to yours. Modify this file and create other files to create an experiment of 5 runs which compares the following algorithms on the same processes: There will be 20 processes. All processes arrive at time 0.0, have constant duration 100, constant I/O bursts of 10, and basepriority of 1.0. The first 10 processes have CPU bursts uniformly distributed between 2 and 8. and the last 10 have CPU bursts uniformly distributed between 30 and 40.

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

Discuss what the statistics and graphs tell you about how well the five algorithms perform with these processes, paying particular attention to average waiting time. Explain why or why not the size of the quantum affects the average waiting time in this example. Don't just quote the numbers, but try to understand why the quantum affects the results as it does.

Describe in 100 words or less what you think the main results were and why they occurred. Put your discussion and description into the log file. Print out the html file from a browser and hand it in. Make sure it is clearly labeled as Part 2.

Part 3

Make subdirectories of assign2 called part3a and part3b. Think about each of the following two statements and decide whether or not you agree with them:
  1. If the quantum is long enough, round robin behaves like FCFS.
  2. As the quantum becomes shorter, the average waiting time for round robin increases. (Ignore the context switch time.)
For each of these, design an experiment that will support your decision. Note that you cannot prove either of the above statements are true by doing experiments, but the experiments can be used to support your reasoning. A trivial experiment is not as convincing as a more sophisticated one. Experiments in which FCFS and SJF behave very differently should be used for the first one. Each experiment should have at least 10 processes, with several CPU bursts.

For each of these, create a log file containing tables, graphs and Gantt charts as appropriate. At the end of the log file insert 3 short paragraphs as follows.

  1. Give the statement and a brief explanation about why you agree or disagree with it.
  2. Describe the experiment in words and indicate what you expect it to show.
  3. Describe the results of the experiment and how the results support your explanation on paragraph 1. Make sure you discuss the average waiting time as one of the measures for comparison.


Handing in Parts 2 and 3

You will be handing in three log files. Put them in order with part 2 first followed by part 3a and part 3b. Make sure they are clearly labeled. Staple them together and hand them in at the beginning of class on the due date.


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.