Reputation: 322
I'm trying to embed V8 into an existing code that already has a mainloop.
As I understand it, script->Run()
is executed before the script finishes executing its "main body" (global scope).
The main problem is that in this case my mainloop will hang until the script is executed(My application is single-threaded). Executing scripts in a separate thread also does not look like a good solution, because for each API call of my application from the script, I will have to synchronize the mainloop and the script thread, which in the end can greatly affect the performance and quality of the code.
Also, it would be nice if it was possible to forcibly suspend the execution of JS from the script itself (for example, with the yield function)
Here are the "crutch" solution ideas that are currently available, but they feel terrible:
v8::TryCatch
and TerminateExecution.Upvotes: 0
Views: 141