On Mon, Apr 15, 2019 at 4:33 PM Bit Cortex <bitcor...@gmail.com> wrote:
> That is, can this method be called from another thread while V8 is running 
> script code?

I think the answer is "probably not" but it needs some elaboration.

Yes, CpuProfiler::CollectSample(Isolate*) acquires a mutex before
collecting the sample. So far so good.

However, there will be data races when the V8 thread calls other
CpuProfiler methods concurrently (or possibly _any_ V8 methods)
because those methods are _not_ synchronized. Since JS code sometimes
calls into the V8 runtime, I wouldn't want to vouch whether that's
going to work correctly.

V8's test suite never calls it from a different thread. That's perhaps
a good indicator that it's not supposed to be used that way.

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to