A-level Computer Science revision · Processors, software and development

Scheduling algorithms

The idea

The OS scheduler decides which process uses the CPU. Round robin gives each process a fixed time slice in turn. First come first served runs in arrival order. Shortest job first runs the shortest job next. Shortest remaining time pre-empts for a job with less time left. Multi-level feedback queues move processes between priority queues.

  1. Name the algorithm and its rule.
  2. Consider starvation: long jobs may wait forever under SJF.
  3. Round robin is fair but has switching overhead.

Watch out First come first served is not pre-emptive: a long job blocks short ones behind it.

See it worked

Worked example

Jobs of length 8, 2 and 4 arrive together. In what order does shortest job first run them?

  1. Choose the shortest available each time.
  2. 2, then 4, then 8.

Answer 2, 4, 8

Your turn

Question 12 marks

Jobs A (5 ms), B (3 ms) and C (1 ms) arrive together and run first come first served in order A, B, C. When does C finish, in ms?

Question 21 mark

Which algorithm can cause starvation of long jobs?

Choose one
Question 31 mark

Which algorithm gives each process an equal time slice in turn?

Choose one

A-level Computer Science Pro, OCR H446

A-level Computer Science Pro

£119 once

Price rises to £199 on 1 January. Save £80 by joining before then.

At least 12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right.

No VAT is charged.

Independent practice for OCR A-level Computer Science (H446), not endorsed by OCR.

Privacy · Terms