yjhjstz / deep-into-node

In-depth understanding of Node.js: Core Ideas and Source Code Analysis
https://jianghua-yjhs-organization.gitbook.io/in-depth-understanding-of-node.js-core-ideas-and/
4.36k stars 624 forks source link

Isolate 可以理解为一个进程么? #13

Closed JerryC8080 closed 6 years ago

JerryC8080 commented 7 years ago

对于描述:一个 Isolate 是一个独立的虚拟机。对应一个或多个线程。但同一时刻 只能被一个线程进入。所有的 Isolate 彼此之间是完全隔离的, 它们不能够有任何共享的资源。

这样的描述,Isolate 就很像一个进程,进程里面可以包含多个线程,同一时刻只有一个线程被运行。 那么在创建 Isolate 的时候,就相当于另起进程么?

yjhjstz commented 7 years ago

有意思的类比! 但好像搞反了,线程:Isolate 是 1:N的关系。