Community resourceWorksheet

OCR H446 2.1.5 Thinking concurrently

Part 1 · H446 2.1.5 · Thinking concurrently

Concurrency in OCR H446 2.1.5 is judged by dependencies and shared state rather than by speed alone. A live youth-media broadcast lets students decide what can safely overlap, what must wait for data, and what a single shared status flag can hide.

Students will:

  • distinguish tasks that may overlap from tasks tied together by a data dependency
  • justify a pair of broadcast tasks that must stay in strict order
  • explain how two tasks writing one shared status value cause premature publishing
  • describe a separate-flag design that prevents that failure
  • evaluate concurrent processing with benefits, trade-offs and a justified conclusion

Inside: 6 explanation cells, 1 multiple-choice question, 2 fill-in-the-blanks cells and 3 written answers. 27 marks, about 25 to 35 minutes.

Series: H446 2.1.5 · Thinking concurrently, part 1 of 1.

Shared by Coding PathwayVerified teacher

  • 12 cells
  • About 30 minutes
  • CC BY-SA 4.0
  • Shared 31 Aug 2026
  • Updated 3 Sept 2026

Preview

The whole resource, exactly as a class sees it. Answers and marking are held back.

Thinking concurrently

A live youth-media broadcast captures audio and video, creates captions, encodes the result and publishes segments. Some work can overlap; other work must wait for data or shared resources.

By the end, you will be able to

  • distinguish independent tasks from dependent tasks;
  • propose a safe concurrent decomposition;
  • explain scenario-specific benefits;
  • evaluate synchronisation, communication, shared-state and overhead trade-offs.

Reactivate: decomposition identifies components; a dependency states that one component needs another’s result or state.

Concurrency must respect dependencies

Concurrent broadcast tasks and dependenciescapture audiocapture videosynchronise streamswaits for both chunksgenerate captionsencode combined videopublish segmentTasks may overlap only when their required inputs and shared resources make that safe.

Audio and video capture can progress during the same time period. Synchronisation needs corresponding chunks from both. Publishing must wait for the encoded media and captions.

Concurrency means two or more tasks make progress during overlapping periods. On one processor core, a scheduler can give each task short time slices. Parallel processing is the case where tasks actually execute simultaneously, for example on different cores. Therefore concurrency does not guarantee simultaneous execution, and processor pipelining is a different idea.

Worked schedule and trade-off

Safe overlap: capture audio and capture video. Benefit: neither waits for the other, so the live pipeline can remain responsive. Other valid benefits include completing more tasks in a given time and reducing processor idle time while one task waits for input or data. Concurrency does not increase the CPU's clock speed.

Required synchronisation: pair audio/video chunks by timestamp before encoding. Without it, speech and images may drift apart.

Trade-off chain: more concurrent components → coordination and communication → extra processing/complexity. If two tasks update one shared segment status without coordination, a race condition may produce an unpredictable final value. Tasks can also wait indefinitely for each other, called deadlock, when their resource dependencies form a cycle.

Multiple choice1 mark

Which pair can most safely begin concurrently in the supplied model?

  • APublish segment and capture its video
  • BEncode combined video and capture its first frame
  • CCapture audio and capture video
  • DPublish captions before generating them
Fill in the blanks3 marks
A task that needs another task’s result has a gap 1. Coordinating matching stream chunks requires gap 2. Uncontrolled updates to shared state can produce a gap 3.
  • dependency
  • synchronisation
  • race condition
  • cache hit
Written answer6 marks

Identify two additional tasks in the broadcast that could overlap and one pair that must remain ordered. Justify all choices.

State what data or resource connects the tasks.

Students type their answer here.

Guided shared-state problem

Captioning and encoding both write status = 'complete' to one shared segment record. If publishing checks only that value, it may publish after just one task finishes.

Safer model: separate caption_complete and encode_complete flags; publish only when both are True. A lock, message or other synchronisation method may protect updates. The exact mechanism should match the scenario; naming “deadlock” without competing locks does not improve an answer.

Written answer4 marks

Explain the race/shared-state problem and how the two-flag design prevents premature publishing.

Use event order → incorrect state → corrected condition.

Students type their answer here.

Written answer8 marks

Evaluate concurrent processing for this live broadcast. Include at least two benefits, two trade-offs and a justified conclusion.

Apply each point to capture, captions, encoding or publishing.

Students type their answer here.

Checkpoint

Complete the concurrency distinction and benefit chain from memory. There is no answer bank, and correctness is withheld until teacher review.

Fill in the blanks5 marks
Concurrent tasks make progress during checkpoint gap 1 periods. One core may alternate between them using processor-time checkpoint gap 2. Actual simultaneous execution is checkpoint gap 3 processing. A qualified benefit is less processor checkpoint gap 4 time; scheduling and synchronisation add checkpoint gap 5.

Review your understanding

Before submitting, check that you can explain the main distinction in your own words, apply it in an unfamiliar context and justify the resulting behaviour or consequence.