Scheduling and Gantt Charts Flashcards
Why multiprogramming
max CPU utilization
Why CPU scheduling
implement multiprogramming
CPU scheduler criteria
CPU utilization Throughput Turnaround
Wait time
time spent in ready queue
Turnaround time
sum of: wait to get to memory+time in ready Q + CPU time + I/O time
response time
time from submission of request until 1st response produced
scheduling algorithms
FCFS (FIFO), SJF, RR, priority (SJF is form of priority)
burst time
burst in computers language is time slice allocated to CPU Alternate - CPU time for performing calculations CPU bound process might have a few long CPU bursts
determine length of next CPU burst
tn = actual length of nth CPU burst
T (tau)n+1 = predicted value for next CPU burst
a(alpha): 0<=a<=1
Then Tn+1 = atn + (1-a) Tn
need to decide assumptions for a
RR
cpu executes p1 for time quantum, then goes to next process; p1 is back in ready queue at end (FIFO)
quantum must be large for context switch, otherwise overhead is too high
large quantum for RR is FIFO
Gantt chart for RR
time quantum = 4
P1 burst = 24
P2 burst = 3
P3 burst = 3
p1 p2 p3 p1 p1 p1 p1
0-4 4-7 7-10 10-13 14-17 18-21 22-25 26-29