How to run specific part of the SerialGC in a new thread?

Ofir Gordon ofirg6 at gmail.com
Tue Jun 30 07:02:51 UTC 2020


Hi,
Sorry for the late followup, thank you for the answer.
I looked at the WorkGang mechanism and it seems a little overkill for my
purposes, I only want to be able to split the task to a different thread
and wait for it to complete. From what I understand, in order to do this
with WotkGang I need to create a dedicated AbstractGangClass which will
need to include all methods of the scenario I'm trying to run separately..

Is it not possible to use pthread or similar libraries within the code? Is
there another way that doesn't require using WorkGang?

Thanks again

‫בתאריך יום ד׳, 24 ביוני 2020 ב-14:52 מאת ‪Thomas Schatzl‬‏ <‪
thomas.schatzl at oracle.com‬‏>:‬

> Hi,
>
> On 24.06.20 11:42, Ofir Gordon wrote:
> > Hello,
> >
> > 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,
> > Thanks,
> > Ofir
> >
>
>    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.
>
>    Thomas
>


More information about the hotspot-gc-dev mailing list