Skip to content

Concurrent Thinking

2.1.5 Thinking concurrently · Paper 2 · 2 flashcards · 1 question

Definition
Concurrent thinking is the process of recognising and applying the concept of concurrent processing—executing more than one task at the same time. It involves identifying patterns in problems where concurrency can be applied, allowing for more efficient problem-solving.

Understanding Concurrent Thinking

Worked Example
Worked Example: Recording Car Information

Scenario: for each passing car, record number plate and colour.
ApproachWhat happensTypical outcome
SequentialRecord all plates first, then try colours laterMissing/mismatched data likely
Concurrent thinkingCapture plate + colour together per car eventMore complete and accurate records
Why this helps:
• Better data consistency (plate matches colour)
• More efficient handling of each event
• Less risk of missing information
Key Point
ConceptMeaningExample
Concurrent processingSeveral tasks are in progress at the same time: one starts before another has finishedA browser, a music player and an update all running
On a single coreThe processor gives each task a slice of time in turn, so they appear to run togetherThree tasks sharing one core
On several coresDifferent tasks run on different cores at the same instant (parallel processing)One task on each core
Everyday concurrency patternMultiple active activities with shared resources/timeCooking multiple dishes, supermarket checkout lanes

Identifying the Parts of a Problem That Can Run at the Same Time

Definition
Two parts of a problem can be tackled concurrently when neither needs the result of the other. A part that depends on the output of another has to wait for it, so those parts must stay in sequence.
Worked Example
Worked Example: Loading a Web Page
TaskDepends onCan it run concurrently?
Download the HTML fileNothingIt must come first, because it lists the other files needed
Download image 1The HTML fileYes, alongside the other downloads
Download image 2The HTML fileYes, alongside the other downloads
Download the style sheetThe HTML fileYes, alongside the images
Display the finished pageAll of the downloadsNo: it must wait until the others have finished
Method: decompose the problem into tasks, note what each task needs before it can start, then group the tasks that do not depend on each other.