A topic in the Open Knowledge Graph — a free, open map of 15,495 topics and the order to learn them in.

Multicore Processors and Hardware Multithreading

College Depth 112 in the knowledge graph ☐ I know this ☆ Set as goal
1topic build on this
531prerequisites beneath it
See this on the map →
CPU PipeliningCache Memory Design+2 more→→GPU Architecture and SIMT Execution
multicore parallelism multithreading SMT flynn-taxonomy shared-memory thread-level-parallelism

Core Idea

A multicore processor places several complete processor cores on one chip, each able to run its own thread, usually sharing a last-level cache and main memory. Chip makers turned to multicore designs in the mid-2000s because raising clock rates further had become limited by power and heat. Hardware multithreading is a related idea inside a single core: the core keeps the state of several threads and switches among them, or issues from several at once, to keep its pipeline busy while one thread waits. Both deliver speed only when software supplies multiple threads of work.

How It's Best Learned

Start from the power problem: show that dynamic power grows with clock frequency and with the square of voltage, so faster single cores ran into heat limits. Use Flynn's taxonomy to place a multicore chip as MIMD. Then sketch one pipeline over time for coarse-grained, fine-grained and simultaneous multithreading, coloring each issue slot by thread, and finish with Amdahl's law calculations to show why serial code limits the gain.

Common Misconceptions

Explainer

For decades, programs got faster each year without any changes because processor clock rates kept climbing. In the mid-2000s that trend stalled. Dynamic power in a chip grows with clock frequency and with the square of supply voltage. Voltages could no longer be lowered much, so higher clock rates meant chips too hot to cool cheaply. Transistors were still shrinking, though, so designers had more of them to spend. They spent them on more cores.

A multicore processor is several full cores, each with its own pipeline, registers and usually private L1 and L2 caches, on one chip. The cores typically share a last-level cache and the connection to main memory. In Michael Flynn's 1966 taxonomy, which classifies machines by instruction streams and data streams, a multicore chip is MIMD: multiple instruction streams operating on multiple data streams. All cores see one shared address space, so threads communicate by reading and writing memory. Because each core caches data, the chip needs a cache coherence protocol so that a write by one core is seen correctly by the others.

Hardware multithreading attacks a different problem: a single core's pipeline often sits idle, for example while waiting hundreds of cycles for a cache miss. If the core holds the state of several threads, with a separate program counter and register set for each, it can use those idle slots. In coarse-grained multithreading the core switches threads only on long stalls. In fine-grained multithreading it switches every cycle. In simultaneous multithreading (SMT), used in Intel's Hyper-Threading, a superscalar core issues instructions from several threads in the same cycle. The operating system sees each hardware thread as a logical processor.

None of this helps a program that has only one thread. Software must expose parallelism, and Amdahl's law limits the payoff. If a fraction s of the work is serial, the speedup on n cores is at most 1 / (s + (1 - s) / n). With s = 0.1, even unlimited cores cannot exceed 10x. Sharing also brings costs: threads that touch the same data need locks or atomic operations, and cores contending for one memory system can slow one another down.

Multicore and multithreaded designs are now standard in phones, laptops and servers. The next step in the same direction is the GPU, which runs thousands of simple threads at once.

Practice Questions 4 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Assembly Language Basics → CPU Datapath → Instruction Fetch-Decode-Execute Cycle → CPU Control Unit → Microinstruction Format and Control Signals → Hardwired vs. Microprogrammed Control → Processor Control Unit Design → Finite State Machines in Processor Control → Single-Cycle Processor Architecture → Multi-Cycle Processor Design and Execution States → CPU Pipelining → CPU Performance Metrics and Amdahl's Law → Multicore Processors and Hardware Multithreading

Longest path: 113 steps · 531 total prerequisite topics

Prerequisites (4)

Leads To (1)