Scheduling/Processor Management Flashcards
(FCFS) First Come First Served Scheduling + pros and cons
allocates the processor in order of the process creation time
Pros:
No unnecessary switching between processes
Every process will eventually be given some processing time
Cons:
The average waiting time is usually too long
Round robin scheduling + pros and cons
Similar to FCFS except each process only has a pre-defined amount of time (called the time quantum) that they can occupy the processor for, after arriving at the processor the process execution will either be interrupted and it will be placed back at the end of the (circular) queue or it will finish its execution before the time quantum has expired.
New processes get priority ahead of processes that have already been given execution time
Pros:
Distributes resources in a fair manner
A short process can pass through in a relatively quick manner
Cons:
Long average waiting time when a process elapses multiple time quanta
Performance is heavily reliant on the defined time quantum, a long time quantum will mean it acts exactly like FCFS
(
The time quantum should be long comparative to the time taken for a context-switch
The majority of processes should complete within one time quantum
)
Shortest process next scheduling + pros and cons
Schedules processes in order of their predicted execution time, has two variants (pre-emptive and non-pre-emptive)
Pre-emptive - processes can be interrupted before they have finished execution
Non-pre-emptive - processes cannot be interrupted before they have finished execution
Pros:
Has the minimum average waiting time (pre-emptive)
Cons:
Execution time has to be estimated
Longer processes may have to wait a very long time before they are executed
What is an interactive, normal and batch process
Interactive - a process with lots of IO
Normal - e.g a system service
Batch - a process without any IO
Multi-level queues pros and cons
Pros:
Complex, can accommodate a range of different performance objectives
Cons:
Complex, difficult to calibrate
Approaches to multi-processor scheduling - Common ready queue
When a processor becomes available, it will select a process from a common shared queue
Approaches to multi-processor scheduling - Private queues
When a processor becomes available, it will choose a new process from its own private queue
Two methods to improve the performance of multi-processor scheduling
Load balancing - balancing processes across the processors, using common ready queues naturally enforces load balancing as each processor takes processes from the same queue
Processor affinity - when you keep a process running on the same processor to keep the cache warm, soft affinity is when you only move processes when there is a good reason. Private queues automatically enforce processor affinity
Each method counteracts the other