State and explain the 3 types of queues in scheduling.
Job queue: processes awaiting admission. Ready queue: processes in main memory, waiting to execute. Wait queue: processes waiting for an event.
Describe the CPU/IO burst cycle.
Process execution interleaves CPU execution with waiting for I/O.
Describe an IO bound process.
It has many short CPU bursts.
Describe a CPU bound process.
It has fewer longer CPU bursts.
How is CPU utilisation maximised?
With multiprogramming: doing something else when waiting for IO.
What does the CPU scheduler do?
Select which process should be executed next, and allocate it to the CPU.
What does the job scheduler do?
Select which processes should be brought into the ready queue.
Compare between CPU and job scheduler.
CPU scheduler invoked frequently (milliseconds), job scheduler invoked infrequently (seconds/minutes). Some systems only have a CPU scheduler.
State the 3 ways of handling idling.
Busy wait, Halt CPU until interrupted, Invent an idle process.
Describe the pros/cons of busy wait.
Short response time but inefficient.
Describe the pros/cons of halting CPU until interrupted.
Saves energy but increases latency.
Describe the pros/cons of using an idle process.
The idle process can do housekeeping, but consumes resources and slows interrupt response.
What does the dispatcher do?
The dispatcher gives control of the CPU to the selected process by: Switching context, Switching to user mode, Resume execution of the user process.
Define dispatch latency.
Dispatch latency is the time it takes to complete the stop/start procedure of the dispatcher.
Compare the non-preemptive and pre-emptive scheduler.
Non-preemptive: running process decides when it enters the scheduler (running -> ready). Pre-emptive: scheduler can force scheduler entry.
State the hardware requirement for pre-emptive scheduling.
Hardware support for regular timer.
State the system requirement for non-preemptive scheduling.
Requires a yield system call so running process can enter the scheduler.
Describe the pros/cons of pre-emptive scheduling.
Prevents denial of service: long running processes are pre-empted. More complex to implement.
Define turnaround time.
The total time from process submission to completion.
Define waiting time.
The total time of a process in the ready state.
Define response time.
The time for the process to start responding.
State the cons of minimising waiting time.
Penalises IO heavy processes that spend long times in wait state.
State the cons of minimising response time.
Penalises longer running sessions under heavy load.
What does it mean to maximise CPU utilisation?
To maximise the time the CPU is actively in use.