Operating systems / Multi-core processors

Multi-core processors

Why processors stopped getting faster clocks around 2004 and got more cores instead, and why four cores rarely make a program four times faster.

Beginner7 steps~7 min
Core — a complete processor on the chip
Parallel work — can be shared between cores
Serial work — must run in order, on one core
Power — electricity in, heat out
// THE SHORT VERSION

In 30 seconds

For decades chips got faster by raising the clock speed. Around 2004 that stopped: each step up in speed cost far more power, and the heat could no longer be carried away.

Designers put several complete processors, called cores, on one chip instead. Cores work at the same instant, so jobs that can be divided finish sooner.

The catch is that software must be written to divide its work, and the part that cannot be divided limits the gain. That limit is Amdahl’s law.

Multi-core processors, step by step

STEPS01 / 07

The cube rule for power is a rule of thumb, and Amdahl’s law leaves out the cost of coordinating cores and the slowdown when they compete for memory. Real speedups are usually a little lower.

STEP 01 / 07 The clock-speed race stalls
THE MATH
1994: 0.1 GHz 2004: 3.8 GHz (×38) 2024: about 6 GHz (×1.6)
  1. Step 1: The clock-speed race stalls. A processor works to the beat of a clock, and for decades the simple way to make one faster was a faster beat. Top desktop chips went from 0.1 GHz in 1994 to 3.8 GHz in 2004. Then the climb nearly stopped: twenty years later the fastest chips peak at about 6 GHz.
  2. Step 2: Heat is the wall. The power a chip burns is roughly capacitance × voltage squared × clock frequency. A faster clock also needs a higher voltage, so power climbs roughly with the cube of the speed: 20% more clock costs about 73% more power, and nearly all of it leaves as heat. By 2004 desktop chips passed 100 watts, too much to cool cheaply.
  3. Step 3: Two slower cores instead. The same rule works in reverse. Slow a core by 20% and it needs only about half the power. Chips kept getting more transistors, so designers spent them on a second core: two cores at 80% speed use about the same power as one at full speed, yet can do up to 1.6 times the work.
  4. Step 4: Cores run in parallel. Each core is a complete processor that fetches and runs its own instructions, so several cores make progress at the same instant. Four independent one-second tasks take four seconds on one core, one after another. Four cores take one task each and finish them all in one second.
  5. Step 5: Software has to ask. Extra cores do not speed a program up by themselves. A program written as one sequence of instructions (one thread) can only run on one core at a time, and the operating system cannot split it. To use four cores, the programmer must divide the job into pieces that can run at once and make sure they do not trip over shared data.
  6. Step 6: Amdahl’s law. Usually part of a job cannot be split: steps that must happen in order. Take a 100-second job where 20 s is such serial work (s = 0.2) and 80 s can be shared (p = 0.8). On N = 4 cores the shared part drops to 80 / 4 = 20 s, but the serial part stays. Total 40 s: 2.5 times faster, not 4.
  7. Step 7: The ceiling. Add more cores and only the shared part shrinks: 8 cores finish in 30 s, 16 in 25 s. However many cores you add, the 20 s of serial work remains, so this job can never run more than 100 / 20 = 5 times faster. The part that cannot be split decides what many cores are worth.
VALUES SO FAR
clock3.8 GHz in 2004history
1.2× f····rule
2 cores····result
power····result
4 tasks····parallel
s····serial
p····parallel
N = 4····result
limit····ceiling

Spotted a mistake on this page?