Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Is the task of Web API in browser same as the task of thread pool in Node.Js?

For Javascript in Browser and node.js, I am trying to understand the difference between the thread pool and Web API. Both the thread pool, and Web API, enable Javascript to handle asynchronous behavior, so how they are different? Web API after completion of the task sends the task to the Queues from where the task is sent back to the call stack. How do Thread Pool and NodeJS work to imitate asynchronous behavior?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

They are completely unrelated.


The main event loop is where most JavaScript code you write runs.

Expensive operations (such as file access or code you explicitly run in a worker) are often done outside of the main event loop. This frees up the main event loop to do other work.

We say something is asynchronous when it is performed outside the main event loop because it isn't done in sequence with the rest of the work the main event loop is doing.

The thread pool is just how Node.js' particular implementation manages those asynchronous tasks.


The Web APIs are a set of classes/functions/etc provided to JavaScript programs that run in browsers which have functionality that is often desired in JS programs that are embedded in webpages but which are not part of the JavaScript language.

e.g. the Object constructor is a core part of JavaScript, while the HTML DOM API is a Web API.

Some of those features (such as XMLHttpRequest) do work outside the main event loop, but that isn't an intrinsic feature of Web APIs (e.g. the DOM API doesn't).

Node.js puts equivalent functionality in built-in modules (such as the fs module).

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!