18
Web Workers

Web Workers

When jank is unfixable on the main thread, you reach for workers. This course covers when they pay, what's actually shareable across threads, and the patterns that don't fall over.

~ 130 min·10 lessons·updated may 2026

What you'll learn


Lessons

Read in order. Each lesson stands on its own, but the order is deliberate.

10 lessons · ~130 min total

  1. 01
    Why workers exist
    The event loop, jank, and the cases nothing else fixes.
    13 min
  2. 02
    Dedicated workers
    Spawning, messaging, terminating — the lifecycle in 60 seconds.
    14 min
  3. 03
    The postMessage protocol
    What's structured-cloned, what isn't, and the cost.
    15 min
  4. 04
    Transferable objects
    Move, don't copy — ArrayBuffer, MessagePort, OffscreenCanvas.
    14 min
  5. 05
    Shared workers
    One thread, many tabs — the cross-tab broker pattern.
    13 min
  6. 06
    Service workers vs web workers
    Same word, different jobs. Don't confuse them.
    11 min
  7. 07
    SharedArrayBuffer and Atomics
    Real shared memory, COOP/COEP headers, and the locks you need.
    14 min
  8. 08
    Worker pools and RPC
    From one-shot tasks to a pool — and a tiny RPC layer.
    14 min
  9. 09
    When workers aren't the answer
    Cost of message passing, when to scheduler.yield instead.
    11 min
  10. 10
    Worker debugging
    Sources panel, separate consoles, and finding errors that vanish.
    11 min

Prerequisites

  • · Comfortable with modern JavaScript and async patterns
  • · Have profiled a page with DevTools at least once

After this, try