All subjects · Computer Science · WCP01 Principles of Computer Science

Processes, process states and scheduling algorithms

Edexcel IAL Computer Science · WCP01 Principles of Computer Science

The OS decides which process uses the CPU and for how long. You need the process states and four scheduling algorithms, and to work out the order and waiting times (spec point 1.2.3).

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Processes and states

A process is a program that is being executed, together with its current state (registers, memory, open files). The OS keeps details in a process control block.

Process states:

Transitions: ready to running (chosen by the scheduler); running to ready (time slice ends or a higher priority process arrives); running to blocked (waits for I/O); blocked to ready (the event happens). A blocked process never goes straight to running.

Scheduling algorithms

Working out waiting times

Waiting time = finish time - burst time (when every process arrives at time 0). Jobs A 8, B 4, C 2, D 6 ms arrive at time 0 in that order:

AlgorithmOrder (start to end, ms)Average wait (ms)
FCFSA 0 to 8, B 8 to 12, C 12 to 14, D 14 to 208.5
SJFC 0 to 2, B 2 to 6, D 6 to 12, A 12 to 205.0
RR, quantum 3A 0 to 3, B 3 to 6, C 6 to 8, D 8 to 11, A 11 to 14, B 14 to 15, D 15 to 18, A 18 to 2010.25

Worked example

Processes P (5 ms), Q (3 ms) and R (1 ms) arrive together in that order. Use round robin with a 2 ms quantum. Find when each finishes.

  1. Timeline: P 0 to 2, Q 2 to 4, R 4 to 5, P 5 to 7, Q 7 to 8, P 8 to 9
  2. Finish times: P at 9, Q at 8, R at 5 ms

Answer: R finishes at 5 ms, Q at 8 ms and P at 9 ms.

Key idea: States: new, ready, running, blocked, terminated. FCFS simple but long waits; SJF lowest average wait but starvation; RR fair with a quantum; multi-level queue separates priorities.

Check yourself

  1. Jobs A 8 ms, B 4 ms, C 2 ms and D 6 ms arrive at time 0 in that order. Using FCFS, what is D's waiting time in ms?
    Show answer

    14 ms. D starts after A, B and C: 8 + 4 + 2 = 14 ms.

  2. The same four jobs (A 8, B 4, C 2, D 6 ms) are scheduled using SJF. What is the average waiting time in ms?
    Show answer

    5 ms. Order C, B, D, A; waits 0, 2, 6, 12; average = 20 / 4 = 5.0 ms.

  3. Using round robin with a 3 ms quantum on A 8, B 4, C 2, D 6 ms (queue order A, B, C, D), at what time does B finish?
    Show answer

    15 ms. Timeline: A 0 to 3, B 3 to 6, C 6 to 8, D 8 to 11, A 11 to 14, B 14 to 15, D 15 to 18, A 18 to 20. B finishes at 15 ms.

  4. A running process requests data from a disk. Which state does it move to?
    • Ready
    • Terminated
    • New
    • Blocked
    Show answer

    Blocked. It cannot continue until the data arrives, so it is blocked (waiting).

  5. Which transition is not possible in the process state model?
    • Ready to running
    • Blocked to running
    • Running to ready
    • Blocked to ready
    Show answer

    Blocked to running. When its event happens a blocked process goes to ready and must wait to be scheduled.

  6. Which algorithm can cause a long job to wait indefinitely if short jobs keep arriving?
    • Round robin
    • First-come, first-served
    • A single queue served in arrival order
    • Shortest job first
    Show answer

    Shortest job first. SJF always prefers short jobs, so a long job can starve.

  7. What is a feature of multi-level queue scheduling?
    • Every process gets exactly the same time slice in one queue
    • Processes are placed in separate queues by type or priority, each with its own algorithm
    • Jobs always run in the order they arrive
    • The shortest job always runs first, whatever its type
    Show answer

    Processes are placed in separate queues by type or priority, each with its own algorithm. Separate queues let interactive and batch work be treated differently.

  8. Explain the effect of making the round robin quantum very small.
    Show answer

    There are many more context switches, so more CPU time is wasted on switching overhead, although the system is very responsive.. Small quantum: responsive but high overhead. Very large quantum: behaves like FCFS.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.