I'm not a V8 expert, but I'll try to answer this. * Each Isolate can only be entered by a single thread at a time. * However, Isolates can be migrated between threads. For example, Node.js only uses a single Context, but has multithreading of background (non-script) code like I/O. This is similar to Python's Global Interpreter Lock. * So if you want scripts to run multithreaded, you need to create at least one Isolate per thread. * Each Context only exists in a single Isolate; you can't migrate a Context from one Isolate to another. * Each Context has a security token. If a context somehow manages to get a reference to another context's object, it can still only interact with that object if the security tokens match, or you write a policy to allow that interaction (here is where my knowledge gets fuzzy).
In general, contexts are designed to be independent and non-interfering, as long as there's no aggressive behavior happening such as denial-of-service (one context allocating all the memory in the system, or running an infinite loop). Consider multiple IFrames on a single web page, each pointing at a different domain--the scripts on those pages can't spy on each other's objects. So it depends what you mean by "interfere with each other". On Friday, April 29, 2016 at 6:35:07 AM UTC-7, Joris Wijnant wrote: > > > maybe an alternative idea: i've read that it is possible to create > multiple contexts within one isolate. > so instead of multiple isolates, i could create only one, and create > multiple contexts. > > Are those context separated from, or can they interfere with eachother? > and what are the traps you need to look out for when creating multple > contexts? > > -- -- v8-users mailing list [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
