BEFORE STARTING
You will need to download the programs provided with the OSTEP textbook. This can be done by cloning the git repo that contains them with
git clone https://github.com/remzi-arpacidusseau/ostep-homework/
For this assignment, you will be using cpu-sched/scheduler.py
to answer
questions.
Questions
Each question is worth 12.5 points for a total of 100 points.
-
Suppose we have three jobs each of length 150 arriving at time stamp 0. Compute the response time and turnaround time of each when using a SJF scheduler. Also compute the same values when using a FIFO scheduler. What is the average response and turnaround times for each scheduler?
-
Now repeat question 1 but use the job lengths of 225, 75, and 150 (arriving in that order) at time stamp 0.
-
Now assume the same jobs from question 2 but we are now using a RR scheduler with a time slice length of 1. Compute the same values.
-
What types of workloads would provide the same turnaround times for both SJF and FIFO?
-
What types of workloads and time slice lengths would provide the same response times when using SJF or RR?
-
If we increase the job lengths using SJF, what happens to the response times?
-
If we increase the time slice length when using RR, what happens to response times? Write an equation that gives the worst-case reponse time, given 'N' jobs. (Assume that all jobs arrive at the same time and will get one time slice each before a job can receive a second time slice.)
-
Suppose that the cost of a context switch and RR scheduler logic combined is 1ms. If we want to utilize at least 99% of the CPU for jobs, what is the minimum time slice length we can use (given in ms)?