We may want to optimize the average values for these gauges or the maxes or mins . We may also want to minimize the variance so we can have a predictable response time.- CPU Utilization
- percent of time CPU is active
- Throughput
- how many processes are completed per hour.
- Turnaround time
- How long a given process takes to complete (on a busy system)
- Waiting Time
- total Time spent in ready queue (perhaps the best measure since cpu time is not determined by the scheduler.)
- Response time
- time it takes from process start to when first output starts to be printed. This measure is independent of the output device's speed.
__________________________________ | P1 | P2 | P3 | ---------------------------------- 0 14 17 20Average Wait time is (0+14+17)/3 = 10.3
Let tn be the length of the nth CPU burst, and let τn+1 be our predicted value for the next cpu burst. Then, for α, 0 ≤α≤1, define
τn+1 = α tn + (1- α)τnτn stores past history, tn contains the most recent CPU burst history . Changing the value we assign to α changes the relative weight recent and distant history has. If we preempt a process when a shorter one arrives we call this a shortest remaining time first algorithm.
Draw a Gantt chart for the following:
Process | Arrival Time | CPU Burst Time |
P1 | 0 | 7 |
P2 | 1 | 2 |
P3 | 3 | 11 |
P4 | 4 | 4 |
Question for thought. When a process is switched out because of I/O when it is ready, where does it go in the queue, back to the top or to the end?
© Nachum Danzig 2010