This assignment is based on the process scheduling simulator that you used in Assignment 2 and in the recitation sessions.
Start by copying the files from your rec4 directory of Recitation 4 into a new directory. You will modify these files to do a new experiment.
Part 1:
Design an experiment in which
preemptive shortest job first performs
much better than the non-preemptive version.
The preemptive version should have an average waiting
time of at least 20 percent less than the non-preemptive version.
The experiment should have two runs that are identical except for
the algorithm used and both
should use the default context switch time of 0. Each process should have
at least 5 CPU bursts and there should be at least 5 processes.
Run the experiment and produce a log file containing the tabular data.
Part 2:
Think about how the context switch time will affect the average waiting time
in the two runs of your experiment.
Use the methods of Assignment 2 to estimate the average waiting time of
each run when
the context switch time is about 10 percent of the smallest CPU burst.
Then run the simulator with this context switch time and compare the result
to your calculation. Your experiment should have 4 runs, two identical
to those in Part 1 and two with the same non-zero context switch time.
Part 3:
You would expect that preemptive SJF will have more context switches than
the non-preemptive version, and so increasing the context switch time
would increase the average waiting time more for PSJF than SJF.
This is not always the case. Under what conditions would PSJF do better
relative to SJF as the context switch time is increased?
Handing in your assignment
Use this cover sheet.
Consecutively number all of
the pages you turn in.