Hacker News new | ask | show | jobs
by kevingadd 807 days ago
I would be concerned about terminating an isolate on timeout, couldn't it be holding mutexes when you terminate it?
2 comments

If you use SharedArrayBuffers in worker threads, use Atomics.wait to block, and then terminate the worker which would've called Atomics.notify – yes, if no timeout is used on the notify.

But I don't know of any other way this would happen.

V8 isolate termination is more akin to throwing an uncatchable exception, versus killing a thread abruptly. When you ask v8 to terminate an isolate, it does take some time for it to terminate depending on what code is running.