In the v8 engine, JavaScript code is only able to run in the main thread. My goal is to run JavaScript code in a non-main thread so that CPU-intensive tasks cannot interrupt the CPU time of the main thread. However, I am currently at a loss on how to accomplish this.
For this question, I have removed the node.js
tag as I am not interested in utilizing multicore capabilities in node.js. Instead, I am working on implementing threads using the native v8 API. Please refrain from providing solutions related to node.js and instead focus on guiding me based on the v8's C++ API.
The following link explains why V8 code cannot be used in a non-main thread; only native C++ code can be executed in user-defined threads. Is there no solution to this limitation?