Potential issue with CHM.toArray

Doug Lea dl at cs.oswego.edu
Wed Aug 28 11:18:24 UTC 2013

On 08/28/2013 06:10 AM, Paul Sandoz wrote:
> Hi,
> Intermittent failures were reported with the CHM toArray test in the JDK.
> I updated the tests to increase the number of runs and the number of workers and i can reliably reproduce on my laptop, see below.
> The test presumes the size should always increase

CHM has disclaimers (that possibly could be better emphasized) that
size() and related methods return estimates that may not be accurate
during concurrent updates. So the behavior you see doesn't seem
to be forbidden, but is surprising enough that it might be worth
addressing by restarting if post-check of size doesn't match array size.
I will make sure this doesn't induce hidden livelocks etc, and if all
is well, submit update.


More information about the core-libs-dev mailing list