Upload
muhammad-fahim
View
217
Download
0
Embed Size (px)
Citation preview
8/18/2019 ProcessScheduling
1/48
Chapter 9Uniprocessor Scheduling
Operating Systems:
Internals and Design Principles, 6/E
William Stallings
Patricia Roy
Manatee Community College, Venice, FL
©!!", Prentice #all
8/18/2019 ProcessScheduling
2/48
$im o% Scheduling
& $ssign processes to 'e e(ecuted 'y the
processor)s*
&Response time
& +hroughput
& Processor e%%iciency
8/18/2019 ProcessScheduling
3/48
+ypes o% Scheduling
8/18/2019 ProcessScheduling
4/48
Scheduling and Process State
+ransitions
8/18/2019 ProcessScheduling
5/48
Leels o% Scheduling
8/18/2019 ProcessScheduling
6/48
Long-+erm Scheduling
& .etermines /hich programs are admitted
to the system %or processing
&Controls the degree o% multiprogramming& More processes, smaller percentage o%
time each process is e(ecuted
8/18/2019 ProcessScheduling
7/48
Medium-+erm Scheduling
& Part o% the s/apping %unction
& 0ased on the need to manage the degree
o% multiprogramming
8/18/2019 ProcessScheduling
8/48
Short-+erm Scheduling
& 1no/n as the dispatcher
& 2(ecutes most %re3uently
& 4no5ed /hen an eent occurs 6 Cloc5 interrupts
6 478 interrupts
6 8perating system calls 6 Signals
8/18/2019 ProcessScheduling
9/48
Short-+erm Scheduling Criteria
& User-oriented
6 Response +ime
& 2lapsed time 'et/een the su'mission o% a re3uest
until there is output
& System-oriented
6 2%%ectie and e%%icient utili:ation o% the
processor
8/18/2019 ProcessScheduling
10/48
Short-+erm Scheduling Criteria
& Per%ormance-related
6 ;uantitatie
6 Measura'le such as response time and
throughput
8/18/2019 ProcessScheduling
11/48
Scheduling Criteria
8/18/2019 ProcessScheduling
12/48
Scheduling Criteria
8/18/2019 ProcessScheduling
13/48
;ueuing .iagram
8/18/2019 ProcessScheduling
14/48
Priorities
& Scheduler /ill al/ays choose a process o%
higher priority oer one o% lo/er priority
& Use multiple ready 3ueues to
representmultiiple leels o% priority
& Lo/er-priority may su%%er staration
6 $llo/ a process to change its priority 'ased
on its age or e(ecution history
8/18/2019 ProcessScheduling
15/48
Priority ;ueuing
8/18/2019 ProcessScheduling
16/48
.ecision Mode
&
8/18/2019 ProcessScheduling
17/48
.ecision Mode
& Preemptie
6 Currently running process may 'e interrupted
and moed to the Ready state 'y the
operating system
6 $llo/s %or 'etter serice since any one
process cannot monopoli:e the processor %or
ery long
8/18/2019 ProcessScheduling
18/48
Process Scheduling 2(ample
8/18/2019 ProcessScheduling
19/48
First-Come-First-Sered
& 2ach process =oins the Ready 3ueue
& When the current process ceases to
e(ecute, the longest process in the Ready
3ueue is selected
8/18/2019 ProcessScheduling
20/48
First-Come-First-Sered
& $ short process may hae to /ait a ery
long time 'e%ore it can e(ecute
& Faors CPU-'ound processes
6 478 processes hae to /ait until CPU-'ound
process completes
8/18/2019 ProcessScheduling
21/48
Round Ro'in
& Uses preemption 'ased on a cloc5
8/18/2019 ProcessScheduling
22/48
Round Ro'in
& Cloc5 interrupt is generated at periodic
interals
& When an interrupt occurs, the currently
running process is placed in the ready
3ueue
6
8/18/2019 ProcessScheduling
23/48
2%%ect o% Si:e o% Preemption
+ime ;uantum
8/18/2019 ProcessScheduling
24/48
2%%ect o% Si:e o% Preemption
+ime ;uantum
8/18/2019 ProcessScheduling
25/48
;ueuing .iagram
8/18/2019 ProcessScheduling
26/48
Shortest Process
8/18/2019 ProcessScheduling
27/48
Shortest Process
8/18/2019 ProcessScheduling
28/48
2(ponential Smoothing
Coe%%icients
8/18/2019 ProcessScheduling
29/48
Use 8% 2(ponential $eraging
8/18/2019 ProcessScheduling
30/48
Use 8% 2(ponential $eraging
8/18/2019 ProcessScheduling
31/48
Shortest Remaining +ime
& Preemptie ersion o% shortest process
ne(t policy
& Must estimate processing time
8/18/2019 ProcessScheduling
32/48
#ighest Response Ratio
8/18/2019 ProcessScheduling
33/48
Feed'ac5
& Penali:e =o's that hae 'een running
longer
& .on>t 5no/ remaining time process needs
to e(ecute
8/18/2019 ProcessScheduling
34/48
Feed'ac5 Scheduling
8/18/2019 ProcessScheduling
35/48
Scheduling Policies
8/18/2019 ProcessScheduling
36/48
Scheduling Policies
8/18/2019 ProcessScheduling
37/48
Comparison o% Scheduling
Policies
8/18/2019 ProcessScheduling
38/48
Formulas
8/18/2019 ProcessScheduling
39/48
8/18/2019 ProcessScheduling
40/48
8/18/2019 ProcessScheduling
41/48
8/18/2019 ProcessScheduling
42/48
8/18/2019 ProcessScheduling
43/48
Simulation Result %or Waiting
+ime
8/18/2019 ProcessScheduling
44/48
Fair-Share Scheduling
& User>s application runs as a collection o%
processes )threads*
& User is concerned a'out the per%ormance
o% the application
&
8/18/2019 ProcessScheduling
45/48
Fair-Share Scheduler
8/18/2019 ProcessScheduling
46/48
+raditional U
8/18/2019 ProcessScheduling
47/48
0ands
& .ecreasing order o% priority
6 S/apper
6 0loc5 478 deice control
6 File manipulation
6 Character 478 deice control
6 User processes
2 l % + diti l U
8/18/2019 ProcessScheduling
48/48
2(ample o% +raditional U