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

231
Visualizações
How to multithread a recursive function javascript

Hey i was wondering how i would go about dynamically call a function like the following:

async function xxx(number) { 
  if(number == 10) return
  xxx(number + 1);
}

My goal is instead of having it call 1 at a time i want it to call 3/4 and run side by side(if 1 thread has checked number 2 others wont check), the number of threads depending on the needed outcome. This is a basic version but good example of what i need done

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use Web worker here to perform a task from another thread. Web worker gives that ability to run a task in background without affecting the main thread, Please check this link for more info using web worker

I will also recommend you to check the difference between Service worker and Web worker so that you can analyse what suits the best for the use case, please check this link

about 4 years ago · Juan Pablo Isaza 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