I also have these questions and if any v8 experts(or people with
replated knowledge/experience) see this post please give us some
information about them.

We are embedding v8 into our HTTP server and creating one isolate
per thread, which may run multiple JavaScript scripts concurrently
(in separate contexts).

In case scripts run too long, we use a watchdog thread to kill the
worker thread, and inside the installed signal handler, we call
isolate->TerminateExecution to stop the script. Since the isolate
is running multiple scripts, we just want to kill the one which
really timed out but preserve others(CancelTerminateExecution?).

Is that possible to achieve? If so, what should I pay attention to?

Any advice will be appreciated!

--
Jianyong Chen


On Thursday, January 24, 2019 at 11:29:59 PM UTC+8 crdu...@gmail.com wrote:

> I'm trying to understand if an how an Isolate, and the Contexts within the 
> Isolate, can be used after Isolate::TerminateExecution is called.
> In v8.h, the documentation for Isolate::CancelTerminateExecution says:
>
> Resume execution capability in the given isolate, whose execution
> was previously forcefully terminated using TerminateExecution().
> When execution is forcefully terminated using TerminateExecution(),
> the isolate can not resume execution until all JavaScript frames
> have propagated the uncatchable exception which is generated.  This
> method allows the program embedding the engine to handle the
> termination event and resume execution capability, even if
> JavaScript frames remain on the stack.
> This method can be used by any thread even if that thread has not
> acquired the V8 lock with a Locker object.
>
>
> It's not clear to me what this means for the Contexts that exist within 
> the Isolate at the time TerminateExecution was called.
> Does the terminate exception get raised in all Contexts within the Isolate?
> Does the terminate exception only get raised in the current active Context?
> After calling CancelTerminateExecution, can the existing Contexts still be 
> used?
>
> Thanks,
> Chris
>
>

-- 
-- 
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/edafcd56-d424-43de-b5cc-b4e3d7c9bbdfn%40googlegroups.com.

Reply via email to