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

133
Visualizações
Are forked processes garbage collected by deleting their reference objects?

I have a service that needs to keep multiple forked processes in a round robin. When I am done with one process, I do not call child.kill(), instead I simply shift an array (delete the reference object) that contains the child objects.

uses node v11.0.0

const children = [
  child_process.fork('../script.js'),
  child_process.fork('../script.js')
];

console.log(
  children.map(c => c.connected)
); // [true, true]

child.shift();

console.log(
  children.map(c => c.connected)
); // [true]

After shifting, is the deleted child process completely garbage collected by the parent process?

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

0

After shifting, is the deleted child process completely garbage collected by the parent process?

No. A child process is an OS level thing, not a Javascript thing. It won't be affected by garbage collection in the way you describe. If you mean for the child to exit, you need to either kill it or send it a message telling it to exit.

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