Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda