A Crash Course On Worker Threads
summary
Node.js 10.5 introduces worker_threads (use 12.11.0+ for stable) and demonstrates a concrete hello‑world example, message passing and workerData usage, plus termination semantics. A real project builds a musician "six degrees" finder: single‑thread BFS takes ~14s, switching to bi-directional search cuts it to under 3s, and running two concurrent worker threads drops runtime to ~700ms. The uploader publishes the partial database and a Glitch visualizer; discussion covers shared memory/transferable buffers and worker pooling.
AI-written summary · about
chapters (8)
- 0:00Introduction and setup
- 2:51What are worker threads
- 8:54Hello world example
- 14:27Breadth-first search demo
- 18:46Bi-directional search
- 20:10Worker threads in action
- 22:58Performance comparison
- 25:09Live demo and resources
related talks
26mA Crash Course on Worker Threads
35mNodeJS: from single thread to worker threads
33mNode.js: The Road to Workers
34mNode.js: The Road to Workers
28mNode.js: The Road to Workers
30mParallel Universes: Node.js
13mConcurrency vs Parallelism in Node.js: Understanding the Event Loop & Worker Threads
52mShared Memory in Multithreaded Node.js
