# Web Workers Resources

## Knowledge

- [Spec: HTML Living Standard — Web workers (WHATWG)](https://html.spec.whatwg.org/multipage/workers.html)
  Normative source for dedicated/shared workers, lifecycle, messaging, and the worker execution model. Use for: any claim about how workers actually work.
- [MDN: Web Workers API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
  Browser-facing overview of worker types and the API map. Use for: orientation before the spec.
- [MDN: Using Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)
  Practical guide: creating workers, messaging, error handling, dedicated vs shared patterns. Use for: first implementation mental model and examples.
- [MDN: Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker)
  Interface reference for dedicated workers (`postMessage`, `terminate`, events). Use for: API surface while designing.
- [MDN: SharedWorker](https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker)
  Multi-context worker interface and `port` messaging. Use for: cross-tab / multi-script design decisions.
- [MDN: Functions and classes available to Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers)
  What exists inside a worker (and what does not — notably no DOM). Use for: capability boundaries in design reviews.
- [web.dev: Use web workers to run JavaScript off the main thread](https://web.dev/articles/off-main-thread)
  Architecture framing: main-thread bottlenecks, off-main-thread design, messaging cost. Use for: system-design “when and why” lens.
- [Surma: When should you be using Web Workers?](https://surma.dev/things/when-workers/)
  Performance-minded decision guide (work still costs CPU; workers move it off the UI thread). Use for: choose/reject heuristics and cost realism.
- [Smashing Magazine: Exploring The Potential Of Web Workers For Multithreading](https://www.smashingmagazine.com/2023/04/potential-web-workers-multithreading-web/)
  Broader FE overview of multithreading motivations and patterns. Use for: secondary orientation; verify claims against MDN/spec.
- [MDN: Structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
  What clones, what throws (`DataCloneError`). Use for: message payload design reviews.
- [MDN: Transferable objects](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Transferable_objects)
  Ownership-move model and transfer list. Use for: large binary / zero-copy designs.
- [Surma: Is postMessage slow?](https://surma.dev/things/is-postmessage-slow/)
  Measured cost framing, RAIL-ish budgets, patches/chunking/transfer escapes. Use for: “is the channel the bottleneck?” decisions.

## Wisdom (Communities)

- [Stack Overflow — [web-worker]](https://stackoverflow.com/questions/tagged/web-worker)
  Real packaging, messaging, transferables, and lifecycle edge cases. Use for: debugging production-ish failures.
- [r/webdev](https://www.reddit.com/r/webdev/) and [r/ExperiencedDevs](https://www.reddit.com/r/ExperiencedDevs/)
  Architecture tradeoff discussions in product context. Use for: second opinions — treat as anecdotes; verify against the spec.

- [MDN: Functions and classes available to workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers)
  Capability inventory (what exists off the main thread). Use for: design-review “can this API run in a worker?”
- [webpack: Web Workers](https://webpack.js.org/guides/web-workers/) / [Vite: Web Workers](https://vite.dev/guide/features.html#web-workers)
  Bundler patterns (`new URL(..., import.meta.url)`, Vite `?worker`). Use for: integration, not platform semantics.
- [MDN: BroadcastChannel](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel)
  Lighter same-origin tab messaging without a shared process. Use for: multi-tab notify vs SharedWorker decision.

## Gaps

- No single canonical “Web Workers at scale” design book; worker pools, Comlink-style RPC, and WASM+worker pipelines are mostly scattered articles. Prefer primary sources for capability claims; treat blog architecture as opinion until measured.
- SharedArrayBuffer + COOP/COEP isolation still a gap for a full shared-memory lesson if the mission ever expands there.

