由fork(新进程)或spawn(子进程)创建的新的node.js进程是否拥有自己的单独调用堆栈? [英] Does a new node.js process created by fork (new process) or spawn (child process) get it's own separate call stack?

查看:79
本文介绍了由fork(新进程)或spawn(子进程)创建的新的node.js进程是否拥有自己的单独调用堆栈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过分叉进程或生成新的子进程以编程方式创建新的node.js进程时;

When creating a new node.js process programmatically by forking a process or spawning a new child process; does the new process or child process get it's own separate call stack?

推荐答案

是的,因为正如您提到的那样,它们是新的进程?

Yes because as you mention yourself, they are new processes.

来自维基百科:



  • 进程是通常是独立的,而线程作为进程的子集存在

  • 进程携带大量状态信息,而进程内的多个线程共享状态以及内存和其他资源

  • 进程具有单独的地址空间,而线程共享它们的地址空间

实际上,线程也具有自己的调用堆栈,因此,无论如何创建新的node.js进程,都必须如此。

In fact, threads have their own call stack as well so, new node.js processes regardless of how they were created must.

这篇关于由fork(新进程)或spawn(子进程)创建的新的node.js进程是否拥有自己的单独调用堆栈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆