programmingconcepts

Track 6

Concurrency

Doing several things at once: threads, async and await, and the timing bugs that shared data invites.

2 pages, each with a live figure. Read them in order: later pages build on earlier ones.

  1. 6.2Async and awaitStep throughA way to write code that waits (for the network, a disk, a timer) without blocking: await pauses the function and lets other work run until the result is ready.
  2. 6.3Race conditionsReplayA bug where the result depends on the timing of threads or tasks that share data, so the same code is right on one run and wrong on the next.

Coming soon

  • Threads

Newsletter

One new concept each week, by email.

Signup opens soon.