RFR (XS): Enable UseCountedLoopSafepoints with Shenandoah
Lennart Börjeson
lennart.borjeson at cinnober.com
Tue Dec 20 15:50:47 UTC 2016
> 20 dec. 2016 kl. 16:27 skrev Simone Bordet <simone.bordet at gmail.com>:
>
> Hi,
>
> On Tue, Dec 20, 2016 at 4:18 PM, Lennart Börjeson
> <lennart.borjeson at cinnober.com> wrote:
>> I feel I must chip in here…
>>
>> (I’m continuously testing Shenandoah, as well as other JVM variants, with our products, as part of my work.)
>>
>> We have recently encountered an issue with a commercial JVM which had elected to skip safepoint checks for all counted loops. This broke our product, since we have a crucial spin wait in a long-indexed loop.
>
> Wow. Can you detail how your product makes use of the fact that the
> JVM is polling (or not) for a safepoint ?
> I'm guessing you are doing this from native code ? Custom JVM modifications ?
No, just standard java. And I wouldn’t say we *made use* of it, we just had some code which worked in one JVM and not in the next…
In our case, we had a while-loop testing a long variable, which somehow was deemed to be a counted loop, and consequently not checked under the new behaviour. Very tricky to identify.
>
>> (As you know, the JVM normally inserts safepoint checks in long-indexed, but not in int-indexed, counted loops.)
>>
>> Such a change in behaviour is extremely hard to track down, and I regard it as a significant functional change.
>
> Would not be the opposite, i.e. your product relying on very specific
> implementation detail of how the JVM works ?
>
Well, you’re *always* dependent on how the JVM works, aren’t you. ;-)
More information about the shenandoah-dev
mailing list