Description
A look at worker threads in nodejs and shared memory. Tagged with node, programming, javascript, multithreading.
Summary
- Introduction Workers threads in Node.js are a way to offload CPU intensive tasks away from the single-threaded process which Node gives you.
- I have but One Thread to give - Node.js The decision to make Node.js single-threaded came from the decision of not changing the language design itself, Adding a multithread module to Javascript can change the way the language is written itself.
- Check out this wonderful article about Shared buffers and Atomics here We can easily use the worker thread module by importing it into our file.
- When memory is shared, multiple threads can read and write the same data in memory.