What is the role of Isolate in V8? and how can isolate isolate?

Explain "Isolate" what I have found so far.

exp # 1: http://izs.me/v8-docs/classv8_1_1Isolate.html

"Insulation is an isolated instance of a V8 engine. V8 isolates have completely separate states. Objects from one isolate should not be used in other isolates. When a V8 is initialized, an isolate is implicitly created and inserted by default. Embedding can create additional isolates and use them in parallel in several streams: Insulation can be entered by no more than one stream at any one time, and the Locker / Unlocker API can be used for synchronization.

exp # 2: https://developers.google.com/v8/get_started

"Isolation is an instance of a virtual machine with its own heap."

OK, I see. Isolate is an insulated thread that can work separately. The following are my questions.

  • It seems to me that this is only a stream, except that it has its own heap. is there any difference

  • I think Isolate can be used to implement parallel GC. The above definition says that each Isolate cannot be used in another Isolate. But a parallel GC must check (or mark) the main (or other) threads (or isolate) living objects. How is this possible?

  • ? "" - , . , , . ? . , . . , malloc-, , ? malloc "" ?

, "" .

, - "" . .

---- ---- , : Google V8? V8? () ?

+4
2
  • , , , . ?

, , . , , , , , . - JavaScript, JavaScript, - .

  1. , "" GC. , "" "" . GC ( ) ( ) ( ) . ?

Mark & Sweep GC . GC, , , , , JS .

  1. ? "" - , . , , . ? . , . . , malloc-, , ? malloc "" ?

, , , API V8. , , V8 . malloc , js-, , .

+6

: JavaScript , V8.

+1

All Articles