Section 15.4
Operating Systems
15.4 The Scheduler And Dispatcher
In a multiprogramming environment the CPUs time is shared out amongst the
various processes that are running.
It is the job of the scheduler to decide which process to run next.
High-Level Scheduling
The scheduler decides which jobs are allowed into the queue for resources
and what their priorities are.
The Dispatcher (Low-Level Scheduling)
The dispatcher decides which process is allocated CPU time when the CPU becomes
avaliable.
The aim is to make the most effecient use of the computers resources.
Objectives
- Maximise throughput
- Maximise the number of users with acceptable response time
- Balance resource use
- Enforce priorities
- Avoid repeatedly sending low priority jobs to the back of the queue
Not all of these objectives can be fulfilled at once. For example: we need to
acheive a balance between response time and resource utilisation
Low-Level Scheduling Policy Objectives
The dispatcher will consider each proccess in terms of:
- How much CPU time is required
- How much I/O is required
- Whether it is a batch or interactive job
- Whether a response is urgent
- It's priority
- How long it has been waiting
15.4.2 Round Robin Scheduling
Processes are scheduled in a FIFO basis.
The CPUs time is divided into time slices (or quantums).
15.4.3 Alternative Shortest-Job-First Scheduling
The proccess with the smallest runtime completion is next.
Advantages
- Reduces the number of waiting jobs
- Reduces the number of small jobs waiting behind large jobs
Disadvantages
- The user has to estimate how long the jobs will take