Week 4: Process (Short-term schedulers) Flashcards
What is the primary goal of a process scheduler?
To decide which process in the ready state should run next.
What happens if the operating system switches processes too often?
Context switching overhead increases, and the processor spends more time switching than running processes.
What are the two major classes of scheduling?
- non-preemptive: a running process may only move to the blocked state by choosing to do so itself
- preemptive: a running process may move itself to the blocked state or may be moved there automatically by the operating system as a result of a clock interrupt
Why is preemptive scheduling harder to implement than non-preemptive scheduling?
It requires mechanisms to interrupt and resume processes, such as clock interrupts.
What happens in non-preemptive scheduling if a process occupies the CPU for a long time?
It continues running until it voluntarily relinquishes control, potentially causing delays for other processes.
Name five criteria used for process scheduling.
- fairness: make sure each process gets its fair share of processor time
- efficiency: keep the processor busy all the time
- response time: minimise response times for interactive users
- turnaround: minimise the time batch users must wait for output
- throughput: maximise the jobs processed per hour
Why can’t all scheduling criteria be satisfied simultaneously?
Some criteria conflict
What are two simple measures of scheduling algorithm performance?
- Average response time: an average of the time taken for all the processes in an example process queue to start
- Average turnaround time: an average of the time taken for all the processes in an example process queue to finish
What is the First Come First Served (FCFS) scheduling algorithm?
It is a non-preemptive scheduling algorithm that executes the processes in the order they arrive in the queue
What is the Shortest Job First (SJF) scheduling algorithm?
It is a non-preemptive scheduling algorithm that executes the processes that have the smallest known or estimated length
What is the Round Robin (RR) scheduling algorithm?
It is a preemptive scheduling algorithm that executes the processes by giving a time slice in the order that they appeared in the queue. As each process finishes it is deleted from the queue and the Round Robin continues to the next
What is the Priority Queues (PQ) scheduling algorithm?
It is a preemptive scheduling algorithm that executes the processes by to the operating system how important the job is considered to be. The highest priority runs first
Which scheduling algorithm is best for minimizing turnaround time?
Shortest Job First (SJF).
Which algorithm is best suited for interactive systems?
Round Robin (RR), because it minimizes response time.
What are Dynamic Priority Queues scheduling algorithms?
A scheduling mechanism where the operating system adjusts process priorities based on their behaviour, such as CPU usage.