CS 3733 Operating Systems, Fall 2003 Recitation Session 4
Week of September 22.
In this session you will continue using the Process Scheduling Simulator.
You will calculate the load average for the problem done in Recitation 2
and do the
assignment given in class
using the simulator.
- Log on to your account in the Linux Lab.
- Create a rec04 subdirectory of the assign2 directory
that you created in the second recitation session.
- Copy all of the files from the assign2/rec02 directory into
rec04.
Remove any file that has a .gif extension.
If you have not done Recitation 2, do the first 9 steps
that are listed here.
- In the rec04 directory,
execute runps to make sure the simulator still works.
Run the experiment.
Push the Show Data button to display the table of data.
- Recall that the UNIX scheduling algorithm uses the Load Average
in its calculations. The load average is the average number of processes
in the ready queue.
In the next step your will calculate the load average for each of the
two runs in this experiment.
-
The load average 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.
The total waiting time is the total for all of the processes.
You can find it by using the average waiting time given in the
simulator tables.
The time for the experiment is the
time the last process finishes and is given in the table.
Calculate the load average for each of the two runs.
Save the numbers to show to the TA at the end of this lab.
- Review the
assignment given in class.
You will be using the simulator to do this assignment.
- For this problem, there are two processes, each with two CPU bursts
and one I/O burst. The I/O burst is not a problem since for each process
it is constant.
- Modify the myexp.exp file so that it does 4 runs using the
the 4 algorithms in the assignment.
For example, the third run line should be
run myrun algorithm PSJF key "PSJF"
- Modify the myrun.run file as follows:
- Change the comment to Class assignment
- Change the numprocs to 1 in two places.
- Change the duration to constant in two places.
In each case, change the value to the sum of the two CPU bursts
for the process.
In the first case the value should be 11
(since the CPU bursts are 8 and 3).
- Change both ioburst values to constant.
In each case use the I/O burst given in the assignment.
In the first case the value is 7.
- Run the simulator to make sure it still runs OK. Check the Gantt charts
to make sure you are running exactly two processes.
- The last thing we need to do is handle the CPU bursts.
Instead of using one of the three supported distributions, you will
specify the CPU bursts directly.
Change the two cpuburst lines in the myrun.run file to
cpuburst user cpu.1
cpuburst user cpu.2
This tells the simulator to get the CPU bursts from a file.
- Now create the two files, cpu.1 and cpu.2 giving the
CPU bursts of the two processes.
Each file will contain the following information:
the number of CPU bursts and a list of CPU bursts.
For example, the file cpu.1 will contain a single line:
2 8 3
- Now run he simulator again. Generate a log file with tabular data and
4 Gantt charts. The results should be identical to the
posted solution.
- Show the TA your log file and the two numbers you calculated for the
load average earlier.