Is there a reason why RequestInterrupt does not run under DisallowJavascript scope in that case? The docs don't seem to cover that (why is that allowed), or explain what happens if you execute javascript in the interrupt.
RequestInterrupt does interrupt while(true){}, as does the equivalent interrupt in SpiderMonkey, so it does do what I want, it's just that the safety warning. On Tuesday, 22 April 2025 at 08:56:21 UTC+1 Ben Noordhuis wrote: > On Tue, Apr 22, 2025 at 8:50 AM jmr <audrius.b...@gmail.com> wrote: > > > > > There's nothing preventing you from running C++ code in the background > on the non-main JS thread to get events, and then use uv_async_send to send > those events, or otherwise trigger JS to run.... is it really JS level code > that has to be compute bound? Can't you like maybe interject a check the > clock and every 250 milliseconds return to allow promises to resolve and > other JS scheduled events? . > > > > > > Sure, but how? Given the js code is written by users and out of my > control. I can deliver events from a different thread or via uv loop is > doesn't matter, the issue I have is that I have to interrupt the isolate > that is running to do it, and we're saying there is no way to do that and > leave the isolate in a safe state. > > Yes, that won't work with V8. If your JS code never returns, it's > effectively hung. > > RequestInterrupt() is specifically designed to be used in conjunction > with TerminateExecution(), i.e., to kill JS that hangs/busy-loops. > -- -- 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 visit https://groups.google.com/d/msgid/v8-users/2ba5548b-2387-4c6e-a1bc-578925fcf037n%40googlegroups.com.