COA Notes
Fundamentals of parallel processing including Flynn taxonomy, speedup, and parallel architectures.
Introduction
Sequential processing — executing one instruction after another — has a fundamental speed limit. No matter how fast you make a single processor, there is a point where physics says "no faster." Parallel processing breaks through this barrier by using multiple processors working simultaneously on different parts of a problem. Your laptop already does this with its multi-core CPU, and supercomputers take it to extremes with millions of cores. Understanding parallel processing fundamentals helps you think about problems differently — not "how do I solve this faster?" but "how do I split this into pieces that can be solved simultaneously?"
Flynn's Taxonomy
Michael Flynn (1966) classified computer architectures by how many instruction streams and data streams they process simultaneously:
| uniproc. | GPU |
|---|---|
| Rare | Multi- |
| (pipeline) | core |
SISD (Single Instruction, Single Data)
Traditional sequential processor. One instruction operates on one data item at a time. Example: Classic single-core CPU executing instructions one by one.
SIMD (Single Instruction, Multiple Data)
One instruction operates on multiple data items simultaneously. Examples: GPU cores, Intel SSE/AVX, ARM NEON.
MISD (Multiple Instructions, Single Data)
Multiple instructions process the same data — very rare. Potential example: fault-tolerant systems where multiple processors verify the same computation.
MIMD (Multiple Instructions, Multiple Data)
Multiple processors each executing their own instruction stream on their own data. This is the most general and common parallel architecture: multi-core CPUs, clusters, distributed systems.
Measuring Parallel Performance
Speedup
Ideal (linear) speedup: S(p) = p (doubling processors halves time) Reality: Always less than ideal due to serial portions, communication, synchronization.
Efficiency
Amdahl's Law (Fixed Problem Size)
| Example | f = 0.9 (90% parallelizable) |
| p = 10 | Speedup = 1/(0.1 + 0.09) = 5.26× (not 10×!) |
| p = 100 | Speedup = 1/(0.1 + 0.009) = 9.17× (not 100×!) |
| p = ∞ | Speedup = 1/0.1 = 10× maximum ever possible! |
The serial fraction (1-f) is the ultimate bottleneck. Even 10% sequential code limits speedup to 10× regardless of how many processors you add.
Gustafson's Law (Scaled Problem Size)
More optimistic: as we add processors, we typically increase problem size too (more data, finer resolution). The serial portion stays constant while the parallel portion grows.
Parallel Architecture Types
Shared Memory Multiprocessor
| Core 0 | Core 1 | Core 2 | Core 3 | |||
|---|---|---|---|---|---|---|
| +Cache | +Cache | +Cache | +Cache |
- All processors share one address space
- Communication via shared variables (read/write same memory location)
- Challenge: Cache coherence (keeping cached copies consistent)
- Example: Any multi-core laptop or desktop
Distributed Memory (Message Passing)
| Node 0 | Node 1 | Node 2 | ||
|---|---|---|---|---|
| CPU+Mem | ←──→ | CPU+Mem | ←──→ | CPU+Mem |
- Each processor has private memory
- Communication via explicit messages (send/receive)
- No cache coherence problem (no shared memory)
- Scalable to thousands of nodes
- Example: Supercomputers, Hadoop clusters
Types of Parallelism
Data Parallelism
Same operation applied to different data:
Task Parallelism
Different operations on potentially different data:
| Thread 1 | decode_video() |
| Thread 2 | render_graphics() |
| Thread 3 | process_audio() |
| Thread 4 | handle_network() |
Pipeline Parallelism
Data flows through stages, each handled by different processor:
Challenges of Parallel Computing
- Load balancing: All processors should have equal work. If one finishes early, it sits idle.
- Synchronization: Processors must coordinate (barriers, locks). Overhead reduces speedup.
- Communication: Data exchange between processors takes time. Minimize it.
- Race conditions: Two processors modifying shared data simultaneously → incorrect results.
- Deadlock: Processor A waits for B, B waits for A → both stuck forever.
- Diminishing returns: Amdahl's Law — adding more processors gives less benefit each time.
Real-World Parallel Processing
| System | Parallelism Level | Application |
|---|---|---|
| Your laptop | 8-16 cores (MIMD) | Multitasking, compilation |
| GPU in laptop | 2000+ cores (SIMT) | Gaming, AI inference |
| Supercomputer | Millions of cores | Weather simulation, physics |
| Cloud cluster | 100,000+ nodes | Web search, big data |
| Your phone | 8 cores + GPU + NPU | Heterogeneous computing |
Key Takeaways
- Flynn's taxonomy classifies architectures by instruction and data stream multiplicity — MIMD (multi-core) is the most common parallel architecture today
- Amdahl's Law sets a hard limit on speedup based on the sequential fraction — optimizing parallel portions has diminishing returns
- Shared memory is easier to program but harder to scale; distributed memory scales well but requires explicit communication
- Data parallelism (same operation on many data) is the easiest to exploit and the most common in real applications
- The challenge of parallel computing is not more processors — it is finding and exploiting parallelism while minimizing synchronization overhead
- Modern systems are heterogeneous: CPU for sequential logic, GPU for data parallelism, NPU for AI — each processor type handles what it does best
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Parallel Processing Basics.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Computer Organization & Architecture topic.
Search Terms
computer-organization, computer organization & architecture, computer, organization, parallel, processing, basics, parallel processing basics
Related Computer Organization & Architecture Topics