~/talk

Concurrency vs Parallelism in Node.js: Understanding the Event Loop & Worker Threads

Talkat DevConf.CZ 2025 · 2025-06-12..06-14· [nodejs, concurrency]
links:none on file
slides:none on file

Node can handle thousands of concurrent connections on one thread but stalls on CPU-heavy work, so use non-blocking I/O + event loop for API and real-time feeds and move heavy processing to parallel options: child_process (spawn/fork/exec/execFile), cluster, or worker_threads. Microtask ordering is concrete: promises before setTimeout; worker_threads share memory via SharedArrayBuffer instead of separate heaps. A local test on a 12-core MacBook M3 shows 12 cluster workers each with unique PIDs.

AI-written summary · about

  1. 0:00Concurrency vs parallelism
  2. 2:28Node.js event loop
  3. 4:55Microtasks vs macrotasks
  4. 7:25Concurrency with event loop
  5. 8:10Parallelism with child processes
  6. 9:13Scaling with cluster module
  7. 10:14Worker threads for CPU tasks
  8. 11:19Key differences summary
  9. 11:40Q&A on worker threads
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.