I saw the v8 description says:

> Isolate 
<https://v8docs.nodesource.com/node-14.1/d5/dda/classv8_1_1_isolate.html> 
represents 
an isolated instance of the V8 
<https://v8docs.nodesource.com/node-14.1/df/d43/classv8_1_1_v8.html>
 engine. V8 
<https://v8docs.nodesource.com/node-14.1/df/d43/classv8_1_1_v8.html> isolates 
have completely separate states. Objects from one isolate must not be used 
in other isolates. The embedder can create multiple isolates and use them 
in parallel in multiple threads. An isolate can be entered by at most one 
thread at any given time. The Locker/Unlocker API must be used to 
synchronize.

According to my understanding, it seems one isolate can be run in multiple 
thread (not in same time), and multiple isolate can be managed in one 
thread.

Because I want to use Isolate as the VM for my program in multi-tenant 
case, so I read some of the v8 API, I found that `v8::Isolate` has some 
APIs like:

- `Isolate::enter`, `Isolate::exit`
- `Isolate::TerminateExecution`
- `Isolate::CancelTerminateExecution`
- `Isolate::RequestInterrupt`

So, is it possible to "schedule" massive isolates among multiple threads 
using v8 public APIs like above or does v8 support to achieve the 
"schedule" ?

The "schedule" here means maybe:

1. work stealing: let a thread run an isolate which was created and init by 
other thread to balanced the isolate distribution.
2. round-robin: one thread created multiple isolate, when an special event  
happend (maybe recv an os signal), one of the running isolate could be 
paused the execution progress, save the execution context and switch into 
other isolate, after other isolate finished, resume the previous isolate's 
execution.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/820fd518-ea7d-4e02-bf19-a8d1c088c851n%40googlegroups.com.

Reply via email to