2024-01-08
4398
#node
Alberto Gimeno
178
Jan 8, 2024 â‹… 15 min read

Multithreading in Node.js with worker threads

Alberto Gimeno Ecosystem Engineer at GitHub. Sometimes I write about JavaScript, Node.js, and frontend development.

Recent posts:

Solving The Node.js Console.Time Is Not A Function Error

Solving the Node.js console.time is not a function error

Explore the two variants of the `console.time is not a function` error, their possible causes, and how to debug.

Joseph Mawa
Nov 1, 2024 â‹… 6 min read
Why jQuery 4 Is A Good Reminder To Stop Using jQuery

Why jQuery 4 is a good reminder to stop using jQuery

jQuery 4 proves that jQuery’s time is over for web developers. Here are some ways to avoid jQuery and decrease your web bundle size.

Shalitha Suranga
Oct 31, 2024 â‹… 11 min read
How to Create a Multilevel Dropdown Menu in React

How to create a dropdown menu in React

See how to implement a single and multilevel dropdown menu in your React project to make your nav bars more dynamic and user-friendly.

Ibadehin Mojeed
Oct 30, 2024 â‹… 12 min read
Purple background with different connections between icons for an article about building Node.js modules with Rust and NAPI-RS.

Building Node.js modules in Rust with NAPI-RS

NAPI-RS is a great module-building tool for image resizing, cryptography, and more. Learn how to use it with Rust and Node.js.

Rahul Padalkar
Oct 30, 2024 â‹… 7 min read
View all posts

20 Replies to "Multithreading in Node.js with worker threads"

  1. Hi if i have to run heavy cron jobs on a server and every minute i can run heavy memory consuming processes inside that cron as concurrent processes, what do you suggest would opening a new worker thread solve my issue since i believe i am running in Javascript out of heap memory violation when running 10 heavy processes under promise.all while when i run a single process it seems to work fine.

  2. Hi all,

    Any have an idea about the execution of the worker thread. Does this worker thread utilize all System Core or run on single thread?

    1. Martin,
      That would still leave you limited to the amount of work the main thread can do. Everything will just run slower. I would not recommend this approach.
      With worker threads, the program gets access to a new CPU core where new work can be done.
      Niels

Leave a Reply