Download MODERN OPERATING SYSTEMS Third Edition ANDREW S

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Operating Systems
Scheduling
Scheduling – Process Behavior
Bursts of CPU usage alternate with periods of waiting for I/O. (a) A
CPU-bound process. (b) An I/O-bound process.
Categories of Scheduling Algorithms
•
•
•
Batch
Interactive
Real time
Scheduling Algorithm Goals
Some goals of the scheduling algorithm under different
circumstances.
Scheduling in Batch Systems
•
•
•
•
First Come First Served
Shortest Job First
Shortest Remaining-time Next
High Response-radio First
Batch Systems are usually non-preemptible.
Important variables
• Arrival time / Finish time (point)
• Waiting time / Executing time (period)
• Turnaround time = Waiting time + Executing time
= Finish time – Arrival time
• Weighting turnaround time
= Turnaround time / Executing time
• Response radio = Turnaround time / Executing time
= 1 + Waiting time / Executing time
Shortest Job First
An example of shortest job first scheduling.
(a) Running four jobs in the original order. (b) Running them
in shortest job first order.
Scheduling in Interactive Systems
•
•
•
•
•
•
•
Round-robin scheduling
Priority scheduling
Multiple queues
Shortest process next
Guaranteed scheduling
Lottery scheduling
Fair-share scheduling
Round-Robin Scheduling
Round-robin scheduling.
(a) The list of runnable processes. (b) The list of runnable
processes after B uses up its quantum.
Priority Scheduling
A scheduling algorithm with four priority classes.
Scheduling in Real-Time Systems
Schedulable real-time system
Given
m periodic events
event i occurs within period Pi and requires Ci seconds
Then the load can only be handled if
m
Ci
1

i 1 Pi
11
Policy versus Mechanism
Separate what is allowed to be done with how it is done
a process knows which of its children threads are important and need
priority
Scheduling algorithm parameterized
mechanism in the kernel
Parameters filled in by user processes
policy set by user process
12
Thread Scheduling (1)
(a) Possible scheduling of user-level threads with a 50-msec
process quantum and threads that run 5 msec per CPU burst.
Thread Scheduling (2)
(b) Possible scheduling of kernel-level threads with the same
characteristics as (a).
Related documents