I plan to embed Google V8 in my C++ application, which is a multi-threading process. I need to run multiple Javascripts concurrently. Can I create multiple V8 contexts and run different Javascripts in different contexts simultaneously in different threads? Each context has no need to communicate with others. I just want no lock or wait for script concurrent executing. Thanks!
Asked
Active
Viewed 688 times
0
-
https://groups.google.com/forum/#!topic/v8-users/oN_3tVBd3H4 – Qantas 94 Heavy Jul 25 '14 at 03:46
1 Answers
0
Yes, as long as the contexts are from different Isolates.
Each isolate can only be entered by one thread at a time and you need to use v8::Locker to lock the isolate to the particular thread.

xaxxon
- 19,189
- 5
- 50
- 80