Index

Module 03 · How Computers WorkMany programs, one machine

Concurrency & the Hardware

Concurrency and the Hardware
Concurrency and the Hardware · Open board

Two cores reaching for the same shared counter at once, and the three fixes for it: a lock, an atomic add, and giving each core its own copy.

Before you start. Processes, Threads & the Kernel gave you a thread, one flow of instructions moving through a program, and a process, the box that can hold several threads sharing the same memory. This lesson is about what happens the instant two of those threads reach into that shared memory at once, using the CPU’s one-instruction-at-a-time steps from The CPU (fetch-decode-execute, the ISA, assembly).

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

Ninety-five percent of the job splits across cores. How much faster can it possibly finish?

Leave The part that can be split up at 95%, drag Cores you throw at it upward, and watch What the next core buys.

Open The parallel ceiling →

Related paper

Review How Computers Work →

Saved in this browser, and to your account when you sign in.