Scheduling Flashcards
Why is scheduling relevant to the OS?
Kernel decides which process gets to run
What is the job of the scheduler?
Maximise utilisation of the CPU by swapping processes when it stops doing useful work
Why bother?
By interleaving execution when the process is idle, we can maximise CPU utilisation and reduce the time taken for jobs to finish.
What is a CPU scheduler?
CPU becomes idle, choose process to execute from the ready queue
What states can process be in?
Ready
Running
Blocked
Terminated
What is nonpreemptive scheduling?
Processes give up the CPU voluntarily (Co-operative)
What is preemptive scheduling?
Allows scheduling at any point
Why is concurrency control needed when scheduling?
Accessed shared application state may be left inconsistent. Requires coordination of access to shared state
When are processes preempted?
Only on IO block/after completion of system call as OS or Driver data structures may be left partially updated.
How is scheduling evaluated?
CPU Utilisation
Throughput
Turnaround time
Waiting time
Response time
Describe what is meant by CPU Utilisation.
Percentage of time for which CPU is busy.
Describe what is meant by Throughput.
Number of processes completed in a given time.
Describe what is meant by Turnaround time.
Time from submission of process to its completion
Describe what is meant by Waiting time.
Total time in the ready queue
Describe what is meant by Response time
Time from submission of process to time of first response.