Skip to content
Computing · JC 2 · Advanced Programming Paradigms · Semester 1

Introduction to Parallelism: Doing Multiple Things at Once

Students will explore the concept of parallelism by making different parts of a program run at the same time, such as multiple sprites moving independently in a game.

MOE Syllabus OutcomesMOE: Computational Thinking - Middle School

About This Topic

Parallelism enables programs to execute multiple tasks at the same time, creating more responsive and engaging applications. JC 2 students explore this by coding scenarios where elements like game sprites move independently, without one waiting for another. They address key questions such as what parallel execution means, how it adds dynamism to programs, and how to design animations with concurrent character movements. Using tools like Scratch or Python's threading, students witness the shift from sequential to parallel behavior.

This topic aligns with the MOE Computing curriculum's focus on computational thinking in Advanced Programming Paradigms. It develops skills in concurrency, decomposition, and synchronization, preparing students for real-world software like multiplayer games or simulations. By managing independent processes, students build problem-solving abilities essential for higher-level programming.

Active learning benefits this topic greatly because students gain immediate visual feedback from running parallel code. Collaborative coding sessions let them experiment, debug race conditions, and compare sequential versus parallel outputs, turning abstract concurrency into observable, hands-on results that stick.

Key Questions

  1. What does it mean for a computer to do things 'in parallel'?
  2. How can making things happen at the same time make a program more dynamic?
  3. Design a simple animation where two characters move independently.

Learning Objectives

  • Compare the execution flow of sequential versus parallel programs using pseudocode.
  • Design a simple animation demonstrating independent movement of at least two program entities.
  • Explain how concurrency contributes to program dynamism and responsiveness.
  • Identify potential synchronization issues in a parallel execution scenario.

Before You Start

Introduction to Programming Concepts

Why: Students need a foundational understanding of variables, control flow (loops, conditionals), and basic program execution before introducing concurrent execution.

Functions and Procedures

Why: Understanding how to break down a program into smaller, reusable parts is essential for managing multiple independent tasks in parallel.

Key Vocabulary

ParallelismThe ability of a computer system to execute multiple tasks or computations simultaneously, rather than one after another.
ConcurrencyA property of systems where multiple computations can be in progress at the same time. These computations may or may not be actually executing at the same instant.
ThreadA single sequence of execution within a program. Multiple threads can run concurrently within the same program.
SynchronizationThe coordination of concurrent threads or processes to ensure they access shared resources in a controlled manner, preventing conflicts.

Watch Out for These Misconceptions

Common MisconceptionParallelism always makes programs run faster.

What to Teach Instead

Parallelism focuses on simultaneity, not guaranteed speed gains due to overhead like context switching. Hands-on timing experiments in pairs help students measure real performance and discuss why sequential code sometimes wins.

Common MisconceptionComputers execute everything truly at once without limits.

What to Teach Instead

Execution is limited by CPU cores; excess tasks queue up. Group simulations scaling from two to ten threads reveal bottlenecks, prompting discussions on hardware constraints.

Common MisconceptionIndependent parts in parallel code never interfere.

What to Teach Instead

Race conditions arise without synchronization. Collaborative debugging sessions expose errors like sprite overlaps, teaching students to add simple locks through trial and error.

Active Learning Ideas

See all activities

Real-World Connections

  • Video game development studios like Ubisoft use parallel processing extensively to render complex graphics, manage AI behaviors for multiple non-player characters, and handle network traffic for online multiplayer games.
  • Operating systems, such as Windows or macOS, manage numerous parallel processes to run applications like web browsers, music players, and word processors simultaneously, ensuring a smooth user experience.
  • Scientific simulations, used by researchers at institutions like CERN, employ parallelism to model complex phenomena such as particle collisions or weather patterns, requiring massive computational power to run in a reasonable time.

Assessment Ideas

Exit Ticket

Provide students with two short code snippets: one sequential, one parallel, both aiming to move two sprites across the screen. Ask them to write one sentence describing the difference in execution flow and one potential advantage of the parallel approach.

Quick Check

Display a simple scenario on the board: 'Two students are trying to update a shared score in a game. Student A adds points, Student B subtracts points.' Ask students to identify if this is a sequential or parallel task and what problem might arise if they don't coordinate their actions.

Discussion Prompt

Facilitate a class discussion using the prompt: 'Imagine you are designing a traffic light system for a busy intersection. How could you use parallelism to make the system more efficient, and what are the risks if the signals are not synchronized correctly?'

Frequently Asked Questions

How can active learning help teach parallelism in JC2 computing?
Active learning makes concurrency tangible through live coding and observation. Students in pairs or groups build and run parallel animations, immediately seeing smoother movements versus sequential delays. Debugging shared issues collaboratively reinforces synchronization needs, while reflections connect experiences to computational thinking principles. This approach boosts retention over lectures alone.
What tools work best for introducing parallelism to JC2 students?
Block-based platforms like Scratch suit beginners for visual parallelism with sprites, while Python's threading module offers depth for advanced coders. Combine both: start with Scratch prototypes, then port to Python. Provide templates for common patterns like independent loops to focus on concepts.
How does this topic connect to real-world computing applications?
Parallelism powers games, web servers, and AI training by handling multiple tasks efficiently. Students see links to Singapore's tech sector, like autonomous vehicles simulating traffic or apps processing user inputs concurrently. Projects mimic these, building portfolio skills for poly or uni computing courses.
What are signs students grasp parallelism concepts?
Look for designs with smooth, independent movements and basic synchronization, plus explanations of why parallelism improves dynamism. They should compare timings accurately and predict issues like deadlocks. Use rubrics assessing code structure, reflections, and peer teaching to confirm understanding.