Open desertkun opened 7 years ago
Nope. There is currently one true isolate. It would probably be an API breaking change to fix that.
Or not, maybe extern Isolate *isolate
could simply be replaced by a thread local? That feels a little messy though.
I am fine with default isolate, but perhaps there should be a way to create one from python and then pass it as argument into Context or whatever structures you are using (which breaks no API). And yeah, Locker
is to be introduced.
My test indicates that multiple thread having own Context can work fine. Is v8py still running on 1 isolate?
If yes, what is potential problem when multithreading with each thread having own Context?
@kokhoor When I researched this I had too many issues. You'd have to lock/release the GIL
in order for threading to actually work. This implies many scenarios like python->js->python calls and introducing GIL
to this really explodes the complexity.
tl;dr Don't bother.
Considering to migrate from
pyv8
, but not sure if this solution allows me to fire multiple Isolates in different threads.Does not sound like it does.