Web Workers
Engineering · 4 stages · 28 units in the full series · 28 published in English
Series goal
Design Worker communication contracts and buffer ownership, and measure the costs of cancellation, queues, and recovery.
Prerequisites
JavaScript asynchronous behavior and TypedArray
Practice approach and scope
Learning units are not calendar days. Read the explanation and tasks, check the completion criteria, then move on. Use each example as a starting point: change variables and observe the results. Built-in examples and tasks requiring a separate environment are identified separately. Opening an example does not complete a unit.
Existing unit IDs and notes are preserved. The original 01, 02, and 03 examples occupy positions 1, 14, and 28 in the expanded sequence, so the number in the address may differ from the learning order.
Only published English units are linked below. The full series has 28 units.
Learning path
Stage 1 · Messages and Execution Contexts
- 01. Messages and Execution Boundaries — Editable example
- 02. Module Worker Loading — Editable example
- 03. Message Contracts — Editable example
- 04. Structured Clone — Editable example
- 05. TypedArray and Buffer — Editable example
- 06. Error Response Contracts — Editable example
- 07. Observing Main-Thread Responsiveness — Editable example
Stage 2 · Ownership and Cancellation
- 08. Transfer Ownership — Editable example
- 09. Transferring a Partial View — Editable example
- 10. Returning Buffers — Editable example
- 11. Rejecting Stale Results — Editable example
- 12. Cooperative Cancellation — Editable example
- 13. Termination and Recreation — Editable example
- 14. Transfer and Cancellation — Editable example
Stage 3 · Queues and Error Recovery
- 15. Progress Reporting — Editable example
- 16. A Bounded Task Queue — Editable example
- 17. Worker Pool — Editable example
- 18. Restoring Result Order — Editable example
- 19. Timeouts and Duplicate Responses — Editable example
- 20. Failure Recovery — Editable example
- 21. Separating MessageChannels — Editable example
Stage 4 · Validating Throughput and Responsiveness
- 22. Splitting and Merging Data — Editable example
- 23. Shared Memory Requirements — Editable example
- 24. Atomics and Synchronization — Editable example
- 25. Measuring End-to-End Latency — Editable example
- 26. Memory and Pool Limits — Editable example
- 27. Disposal and Restart — Editable example
- 28. Task Queues and Measurement — Editable example
Capstone project and deliverables
Build a cancellable array-processing queue and compare correctness, end-to-end latency, and input responsiveness on the main thread and Workers.
Keep the implementation, run instructions, baseline and changed conditions, failure cases, and recovery steps together. Do not report unmeasured performance or tests you have not run as results.