Operating Systems Scheduling
Lecture 8 Michael O’Boyle
1
Operating Systems Scheduling Lecture 8 Michael OBoyle 1 - - PowerPoint PPT Presentation
Operating Systems Scheduling Lecture 8 Michael OBoyle 1 Scheduling We have talked about context switching an interrupt occurs (device completion, timer interrupt) a thread causes a trap or exception may need to choose a
1
2
CPU burst load store add store read from file store increment index write to file load store add store read from file wait for I/O wait for I/O wait for I/O I/O burst I/O burst I/O burst CPU burst CPU burst
5
6
7
8
9
– an I/O operation – allocation of memory in a system without swapping
– setting the timer allows you to preempt the CPU from a thread even if it doesn’t relinquish it voluntarily
– Overhead doesn’t contribute to the goal of any scheduler
10
11
12
13
14
P P P
1 2 3 24 30 27
1 3 6 30
2
3
17
3 3 24
16 9
2
+
1 n th n
1 n n n
=
6 4 6 4 13 13 13
8 10 6 6 5 9 11 12
CPU burst (ti) "guess" (τi) ti τi 2 time 4 6 8 10 12
P
4 1 26
1
10
P
3
P
1 5 17
P P P
1 1 1 18 30 26 14 4 7 10 22
P
2
P
3
P
1
P
1
P
1
80% of CPU bursts should be shorter than q
27
1 1 19
2 16
4
3 6 18
30
31
32
33
34