How to run specific part of the SerialGC in a new thread?
thomas.schatzl at oracle.com
Wed Jun 24 11:46:37 UTC 2020
On 24.06.20 11:42, Ofir Gordon wrote:
> I'm trying to run a specific procedure within the SerialGC in a
> separate thread, i.e. replace the call for the procedure with a creation of
> a new thread that will run the entire procedure and then return to the main
> thread and continue (the main thread should wait to the splitted thread).
> What is the correct way to do it? Is there any threads mechanism that the
> vm uses in order to split tasks to new threads?
> I tried to simply use the pthread library, but when I add calls to pthread
> methods (like pthread_create) the compilation fails (with segfault..)
> I'll appreciate your help,
probably the simplest way is to add a WorkGang with one thread and
use the run_task() method.
There are a lot of uses of it in the code.
More information about the hotspot-gc-dev