But this fails for CPU-bound tasks that block threads. Before the current NodeJS LTS version, computationally heavy tasks could be farmed out to child processes, taking advantage of multicore CPUs, but processes do not share memory and inter-process communication adds significant overhead. Multithreading support landed in NodeJS as of v10.5.0, and is still flagged as an experimental API. We can now process tasks in separate threads with shared memory, but this power does not come for free. We’ll compare the implementation and performance of a multithreaded NodeJS web server with that of some other industry solutions, and see how we can manage shared memory and orchestrate threads using buffers and atomics.
Thanks for reading ❤
If you liked this post, share it with all of your programming buddies!
Follow me on Facebook | Twitter
Learn More
☞ The Complete Node.js Developer Course (3rd Edition)
☞ Angular & NodeJS - The MEAN Stack Guide
☞ NodeJS - The Complete Guide (incl. MVC, REST APIs, GraphQL)
☞ Node.js: The Complete Guide to Build RESTful APIs (2018)
☞ MERN Stack Front To Back: Full Stack React, Redux & Node.js
☞ Learn Node.js - Node.js API Development for Beginners
☞ How to Perform Web-Scraping using Node.js
☞ Node.js, ExpressJs, MongoDB and Vue.js (MEVN Stack) Application Tutorial
#node-js #javascript