Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-21 Thread Aleksey Shipilev
On Wed, 19 Jan 2022 13:10:55 GMT, Peter Levart wrote: > WDYT? I like the idea of holding to a value strongly for a brief period of time, in order to guarantee progress! The sample code was a bit hard to follow, so I rewrote the loop a bit with comments, see new commit. This still passes tests.

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Peter Levart
On Wed, 19 Jan 2022 13:10:55 GMT, Peter Levart wrote: > Note this matches other places we do the weak-reference loops, for example in > `MethodType`: > https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/invoke/MethodType.java#L1390-L1401 This one does not have the

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Peter Levart
On Wed, 19 Jan 2022 10:44:57 GMT, Aleksey Shipilev wrote: > > So, this patch is fine for making ClassCache more robust as a re-usable > > component inside JDK (checking for non-null return of computeValue). The > > 2nd change, that apparently shields against unbounded accumulation of > > garba

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Peter Levart
On Wed, 19 Jan 2022 08:25:55 GMT, Aleksey Shipilev wrote: >> JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two >> issues with it: >> - The cache cannot disambiguate between cleared SoftReference and the >> accidental passing of `null` value; in that case, the retry

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Aleksey Shipilev
On Wed, 19 Jan 2022 10:42:02 GMT, Peter Levart wrote: > So, this patch is fine for making ClassCache more robust as a re-usable > component inside JDK (checking for non-null return of computeValue). The 2nd > change, that apparently shields against unbounded accumulation of garbage, > might no

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Peter Levart
On Wed, 19 Jan 2022 08:25:55 GMT, Aleksey Shipilev wrote: >> JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two >> issues with it: >> - The cache cannot disambiguate between cleared SoftReference and the >> accidental passing of `null` value; in that case, the retry

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Roman Kennke
On Wed, 19 Jan 2022 08:25:55 GMT, Aleksey Shipilev wrote: >> JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two >> issues with it: >> - The cache cannot disambiguate between cleared SoftReference and the >> accidental passing of `null` value; in that case, the retry

Re: RFR: 8280041: Retry loop issues in java.io.ClassCache [v3]

2022-01-19 Thread Aleksey Shipilev
> JDK-8277072 introduced java.io.ClassCache, but there seem to be at least two > issues with it: > - The cache cannot disambiguate between cleared SoftReference and the > accidental passing of `null` value; in that case, the retry loop would spin > indefinitely; > - If retry loop would spin