CS 3733 Operating Systems, Spring 2008 Assignment 3 Comments
- This assignment was graded on the basis of 30 points.
- Reading is an important skill for computer scientists.
- You must be able to read a problem and understand what it says.
- Many people had trouble understanding:
"context switch time is about 10 percent of the smallest CPU burst."
It means:
- Find the smallest CPU burst.
- Take 10 percent of this.
- Use this number for the context switch time.
- Most people ignored the statement in Part 2 that said:
"compare the result to your calculation."
- You can calculate the number of CPU bursts per process by looking at SJF
(or FCFS) because a context switch only occurs when a CPU burst starts.
Therefore the total number of CPU bursts is the number of context switches.
Divide by the number of processes to find the average.
Note that each process will have the same number of CPU bursts for
PSJF and SJF
since the CPU burst does not end until the process starts I/O
(or terminates), not when it is preempted.
- The question for Part 3:
- The question was:
Under what conditions would PSJF do better relative to SJF as the
context switch time is increased?
- The statement from Assignment 2:
A long context switch time will always increase the the average
waiting time more for PSJF than it does for FCFS or SJF.
- You know that the statement from Assignment 2 in not true.
- Here is the explanation I gave:
In cases in which the load average for PSJF is a lot smaller than
for SJF, each context switch will affect SJF much more.
- The same answer applies to the question here.