Hello,
I'm working on a library where multiple threads can run JS code independently at the same time. In the library, each thread creates and uses its own Isolate. However, I noticed clang's AddressSanitizer was complaining about a data race during Isolate creation. I managed to reproduce the problem outside our library, and I'm sending both the code and the sanitizer's error message (the code needs to be compiled with -std=c++11 and -pthread). I'm using V8 5.8.283.38, but I repeated the test on the master branch and got the same result. What the test does is spawn 10 threads; each one of them just creates and destroys Isolates repeatedly.
I have found a recent issue in the bug tracker [1] that reports a similar problem, but the commit is not included in V8 5.8, and the problem is reproducible in the master branch anyway.
So, my question is: I know that multiple threads can run JS code simultaneously, provided that each thread has its own Isolate; but does Isolate creation need to be synchronous?
Best regards,
Andre