Module 3 - CPU scheduling Flashcards
What is the overall purpose of the the short-term scheduler (aka CPU scheduler)?
The Short-term scheduler (STS), aka CPU scheduler, selects which process in the in memory ready queue that should be executed next and allocates CPU.
What is the overall purpose of the long-term scheduler?
The Long-term scheduler (LTS) (aka job
scheduler) decides whether a new process should be brought into the ready queue in main memory or delayed.
When a process is ready to execute, it is added to the job pool (on disk).
When RAM is sufficiently free, some processes are brought from the job pool to the ready queue (in RAM).
What is the overall purpose of the medium-term
scheduler?
The medium-term scheduler (MTS) temporarily removes processes from
main memory and places them in secondary storage and vice versa,
which is commonly referred to as “swapping in” and “swapping out”.
Define the following scheduling criteria: CPU utilization, throughput, turnaround time, waiting time and response time.
For each metric, state whether the goal is to minimize or maximize the metric.
CPU utilization - The % of time the CPU is executing user level process code.
Goal = Maximize.
Throughput - Number of processes that complete their execution per time unit.
Goal = Maximize.
Turnaroud time - Amount of time to execute a particular process.
Goal = Minimize.
Waiting time - Amount of time a process has been waiting in the ready queue.
Goal = Minimize.
Response time - Amount of time it takes from when a request was submitted until the first response is produced.
Goal = Minimize.
What is meant by CPU burst? What is meant by I/O burst?
CPU burst - When the process is being executed in the CPU.
I/O burst - When the CPU is waiting for I/O for further execution.
What characterizes a CPU bound process? What characterizes an I/O bound process?
CPU bound process - A CPU-bound process spends more time doing computations and
is characterised by few very long CPU bursts.
I/O bound process - An I/O-bound process spends more time doing I/O than computations and is characterised by many short CPU bursts.
What would happen if there was a large majority of CPU bound processes in the ready queue?
If all processes are CPU bound, the I/O waiting queue will almost always be empty, devices will go unused, and the system will be unbalanced.
What would happen if there was a large majority of I/O bound processes in the ready queue?
The ready queue will almost always be empty and the short-term scheduler will have little to do.
How can a good balance between CPU bound processes and I/O bound processes in the ready queue be maintained?
In theory, the medium-term scheduler (MTS) can be used to maintain a good balance between I/O bound and CPU bound processes in the ready queue.
What characterizes an interactive process?
Interactive processes interact constantly with their human users.
Spend a lot of time waiting for keypresses
and mouse operations.
When input is received, the process must be woken up quickly, or the user will find the system to be unresponsive.
Typically, the average delay must fall
between 50 and 150 ms. The variance of
such delay must also be bounded, or the user will find the system to be erratic.
Typical examples:
Command shells and interpreters, text
editors, graphical applications and games.
What requirements on CPU scheduling does interactive processes impose?
– Maximize CPU utilization & throughput.
– Let another process run when the current one is waiting on I/O.
What characterizes a batch process?
Batch processes do not interact with
human users.
‣ Do not need to be responsive.
‣ Often run in the background.
‣ Often penalised by the scheduler.
Typical examples:
‣ Compilers, database search
engines, and scientific computations.
What is meant by scheduler dispatch?
Its the module that gives control of the CPU to the process selected by the short-term scheduler.
What actions are taken during a scheduler dispatch?
The CPU scheduler selects one process from among the processes in memory that are READY to execute.
The scheduler dispatcher then gives the selected process control of the CPU. This action is called scheduler dispatch (SD).
Define dispatch latency.
It is the time taken by the dispatcher in context switching of a process from run state and putting another process in the run state.
Or in simpler terms, it is the time takes for the dispatcher to stop one process and start another running.