RFR: Ensure compensate when ForkJoinWorkerThread is pinned

Miao Zheng duke at openjdk.java.net
Thu Nov 4 09:19:26 UTC 2021


On Fri, 29 Oct 2021 08:16:15 GMT, Miao Zheng <duke at openjdk.java.net> wrote:

> Hello,
> We have a test case about Loom, it can pass before;
> The test case can be seen on this PR;
>  
> But it cannot pass after this patch:
> 
> commit de90a43c7a5f0b28bd0af9271de210475808ca0c
> Author: Alan Bateman <alan.bateman at oracle.com>
> Date:   Wed Sep 1 09:22:23 2021 +0100
>  
>     Replace lock/condition objects to simplify pinned park
> 
>  
> Actually, this modify cause the test fail, because getCondition.await() will call tryCompensate() of ForkJoinPool eventually:
> 
> +    private void parkOnCarrierThread(long nanos) {
> 
> -                if (!parkPermit) {
> -                    // wait to be signalled or interrupted
> -                    getCondition().await();
> 
> +            if (!parkPermit) {
> +                U.park(false, nanos);
>              }
> ``` 
> If ForkJoinWorkerThread are all pinned, how to make vt work correct?
> 
> Thanks,
> 
> Miao

@pron  thank you for your answer, I got it.

-------------

PR: https://git.openjdk.java.net/loom/pull/80


More information about the loom-dev mailing list