Is Node.js really single-threaded? The answer has changed. Learn how to leverage multi-threading to build faster, more scalable applications.
#1about 3 minutes
Debunking the myth of single-threaded Node.js
Node.js has supported multi-threading via the worker_threads module since 2018, contrary to the common misconception that it is single-threaded.
#2about 4 minutes
How worker threads communicate with each other
Threads communicate using MessagePort and MessageChannel for direct messaging or BroadcastChannel to send messages to all threads simultaneously.
#3about 2 minutes
Understanding object serialization between threads
JavaScript objects are not shared between threads but are copied via the structured clone algorithm, with certain objects like SharedArrayBuffer being transferable for efficiency.
#4about 2 minutes
Using Piscina for effective thread pool management
The Piscina library simplifies multi-threading by providing a thread pool to manage worker creation, task scheduling, and result handling automatically.
#5about 2 minutes
Real-world use cases for worker threads
Worker threads are used in libraries like Pino to prevent log loss on exit and within Node.js itself to power loader hooks for ESM and TypeScript support.
#6about 2 minutes
Scaling applications with the Vlt application server
The Vlt application server runs multiple Node.js services as separate threads within a single process, enabling efficient communication via shared memory.
#7about 2 minutes
Demo: Offloading CPU-intensive work to a thread pool
A live demo shows how offloading a synchronous, blocking operation from the main event loop to a Piscina thread pool dramatically improves server throughput.
#8about 2 minutes
Demo: Advanced queue management for load shedding
By managing the task queue and skipping work when the system is overloaded, you can significantly improve tail latency and overall throughput.
#9about 4 minutes
Demo: Scaling apps with Vlt and no code changes
A demonstration shows how the Vlt server can scale both a standard API and a Next.js SSR application across multiple threads using only configuration changes.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
09:15 MIN
Q&A: Arrow functions and Node.js multithreading
JavaScript the Grumpy Parts
02:27 MIN
Moving from concurrency to true parallelism
Multithreading in Javascript: A guide to Web Workers
06:30 MIN
Q&A on web workers and native browser components
The Lean Web
04:10 MIN
The evolution from threads to modern concurrency
Concurrency with Go
02:22 MIN
Leveraging libraries and frameworks for Web Workers
Multithreading in Javascript: A guide to Web Workers
13:10 MIN
Audience Q&A on practical micro-frontend challenges
Micro-frontends anti-patterns
01:45 MIN
Demo code and using web workers for performance
Privacy-first in-browser Generative AI web apps: offline-ready, future-proof, standards-based
03:59 MIN
Understanding the new virtual threads model
Modern Java: This is not your father's Java anymore
Processing 175 WeAreDeveloper World Congress talk videos in 5 hours - with PHP?Every year after the WeAreDevelopers World Congress is over, we have a ton of video footage to edit and release. Most of it is in raw format and needs editing by hand, but a lot of our sessions are also streamed live on YouTube and thus easier to re-...
Chris Heilmann
All the videos of Halfstack London 2024!Last month was Halfstack London, a conference about the web, JavaScript and half a dozen other things. We were there to deliver a talk, but also to record all the sessions and we're happy to share them with you. It took a bit as we had to wait for th...
Severine Hierso
The Concept of Concurrency & Multithreading: What Are They And How They FunctionAs the world around us moves ever more online, the need for software engineers is growing - seemingly by the hour. Whether by building firewalls that fend off the next big data breach, or developing the next app that goes viral, we have a seemingly i...
Chris Heilmann
Dev Digest 136 - No JS(on) of mineNews and ArticlesDouglas Crockford is our featured video, so let's talk about evolving JavaScript and all things JSON. Judicious JSON explains all the weird things in it, you can learn why it can be incredibly slow, people wonder what even is a JSON ...
From learning to earning
Jobs that call for the skills explored in this talk.