这似乎是一个基本问题,但是我找不到任何文档:
分叉和生成node.js进程有什么区别?我已经读过分叉是生成的一种特例,但是使用它们的不同用例/重用分别是什么?
node.js子进程-生成和派生之间的区别
这似乎是一个基本问题,但是我找不到任何文档:
分叉和生成node.js进程有什么区别?我已经读过分叉是生成的一种特例,但是使用它们的不同用例/重用分别是什么?
第4087篇《node.js子进程-生成和派生之间的区别》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
相似问题
问题类别
spawn()方法
child_process.spawn method launches a new process with a given command. It has the following signature −
Read more about options
The spawn() method returns streams (stdout &stderr) and it should be used when the process returns a volume amount of data. spawn() starts receiving the response as soon as the process starts executing.
The fork() Method
child_process.fork method is a special case of spawn() to create Node processes. It has the following signature −
The fork method returns an object with a built-in communication channel in addition to having all the methods in a normal ChildProcess instance.