RFR: 8308609: java/lang/ScopedValue/StressStackOverflow.java fails with "-XX:-VMContinuations"
Andrew Haley
aph at openjdk.org
Sat Jun 10 09:06:40 UTC 2023
On Fri, 9 Jun 2023 17:19:42 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Move `runWith()` from `VirtualThread` to `BaseVirtualThread`.
>>
>> `BoundVirtualThread` does not use `runWith()` to run its task, so when a VM error occurs it can not recover scoped values.
>>
>> Moving `runWith()` into the common subclass of both `VirtualThread` and `BoundVirtualThread` fixes the problem.
>
> src/java.base/share/classes/java/lang/BaseVirtualThread.java line 78:
>
>> 76: op.run();
>> 77: Reference.reachabilityFence(bindings);
>> 78: }
>
> BaseVirtualThread <: Thread. Would it be simpler, and avoid duplicate code, to just change Thread.runWith to be a final method with default access. That would be accessible to VirtualThread and BoundVirtualThread without needing to override runWith.
Sure, that makes sense.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14399#discussion_r1225234193
More information about the hotspot-dev
mailing list