previous
 next 
CS 3733 Operating Systems Notes: CPU Scheduling Simulator
(change semester)

You can find a simple CPU scheduling simulator that is similar to the one you did in your assignments here (needs Java).
You can also run it on the CS network by executing: ~classque/runs2
or from anywhere on the internet if you have a JDK installed by executing:
appletviewer http://classque.cs.utsa.edu/classes/cs3733/scheduling2/index.html

Now we will look at a more general case.
Input needed by a process scheduling simulator:

How would you describe the processes?
A group of processes has similar characteristics, described by A run
Running the simulator with a given algorithm and a given collection of processes.
This is described in a file with extension .run
The file starts with four lines. Each line starts with a key word followed by a value
key wordvalue
name a single word, the name of the file (without the .run)
comment any characters, all on one line
algorithm FCFS, SJF, RR 5, etc.
seed an integer seed for the random number generator

The rest of the file describes groups of processes.
A group is described with 7 lines in a similar format.
There may be as many groups as you like.
Blank lines are ignored.
A group looks like this:

key wordvalue
numprocs an integer representing the number of processes in this group
firstarrival a number giving the arrival time of the first process in the group.
interarrival a distribution giving interarrival times.
duration a distribution giving total CPU times of a process.
cpuburst a distribution giving CPU burst of a process.
ioburst a distribution giving IO burst of a process.
basepriority a number that is ignored by the simulator.
A distribution is one of the following where x and y are numbers:

When you perform a run, you get some numbers for CPU utilization, average waiting time, etc. These are not too useful unless you have something to compare them to.

An experiment is a collection of runs that have almost the same parameters.
For example, you might keep everything the same and just change the algorithm.

An experiment is specified by a file that ends in .exp. The first two lines are similar to that of a run file, giving the name and a comment. The additional lines each start with the word run and correspond to a given run.
Specify a run by naming the run file (without the .run).
The same run file can be reused, by following it with options that override the contents of the run file.
The format of the options are similar to the lines of the run file.
Any number of options can modify a run file.

A configuration file is also necessary to tell the simulator which .run and .exp files to use as well as the names and location of the output files.


Look at the example files.

psconfig   myrun.run   myexp.exp

You can run the programs from here. (Needs Java)

You can also run it from the CS network by executing ~classque/ps/runps1 (Needs X)

You will be able to download version 1.1 of the simulator here.


Next Notes

Back to CS 3733 Notes Table of Contents