Scheduling: Deciding Which Process Runs Next · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.
En anglais

Picking who runs next, and why

Computing · Computer Systems · ages 19-21
Name ______________________   Date ____________
  1. All jobs are ready together on one CPU, burst lengths are known, and switch cost is zero. What does non-preemptive shortest-job-first minimize?

    • The sum of CPU burst lengths
    • The average ready-queue waiting time
    • The number of ready jobs at arrival
  2. Which policy gives each ready job regular short turns on a one-CPU interactive machine?

    • Round robin with short time slices
    • First-come order with no time slices
    • Longest-job-first with no time slices
  3. An ageing rule can raise a ready job's priority as its waiting time grows.

    Circle one:   True   False

  4. In a toy round-robin model, A, B, C arrive at time 0 in that queue order. Their bursts are 6, 4, 2 minutes and the slice is 3 minutes. Ignore switch cost. What is B's response time?

    • 0 minutes
    • 6 minutes
    • 3 minutes
  5. Four jobs arrive at time 0 on one CPU with bursts 7, 3, 5, 1 minutes. Ignore switch cost. How many minutes does SJF reduce mean waiting time compared with running them in that listed order?

    Answer: ______________

  6. Under strict priority, a low-priority job stays ready forever because higher-priority jobs keep arriving. What is this?

    • Starvation
    • A context switch
    • A cache miss
  7. A scheduler can choose the truly shortest next CPU burst from several jobs without knowing or estimating any burst lengths.

    Circle one:   True   False

  8. A round-robin system uses tiny slices. Every context switch takes time. With the same jobs, which change reduces the fraction of CPU time spent switching?

    • Use a shorter time slice
    • Use a longer time slice
    • Keep the slice but make each switch take longer
LightMySky · lightmysky.comW1-mt_QZYzfVIcP6-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Picking who runs next, and why W1-mt_QZYzfVIcP6-s1

  1. The average ready-queue waiting time · Under these assumptions, putting shorter bursts first minimizes mean waiting time; it does not change the jobs or their total CPU demand.
  2. Round robin with short time slices · Round robin rotates through the ready queue instead of letting each selected job finish its whole burst.
  3. True · Ageing uses time spent waiting to improve priority. Preventing starvation also depends on the promotion and tie-breaking rules.
  4. 3 minutes · A uses the first slice from 0 to 3. B first runs at 3, so its response time is 3 minutes.
  5. 4.5 · Listed-order waits average 8. SJF waits average 3.5. The reduction is 8 minus 3.5, or 4.5 minutes.
  6. Starvation · Starvation means a ready job is indefinitely denied service. The arriving higher-priority work keeps passing it.
  7. False · A length-based order needs length information. Real systems may use estimates, which need not identify the truly shortest burst.
  8. Use a longer time slice · Longer slices allow more useful work between switches, but can delay other jobs' next turns. Shorter slices increase switch frequency; making each switch take longer increases its cost.
Worksheet · LightMySky