Potential issue with CHM.toArray

Paul Sandoz paul.sandoz at oracle.com
Fri Aug 30 09:07:08 UTC 2013


On Aug 29, 2013, at 1:44 PM, Doug Lea <dl at cs.oswego.edu> wrote:

> On 08/28/2013 09:13 AM, Peter Levart wrote:
> 
>> It seems that the iteration can traverse through the same tables multiple times
>> (back and forth) by following ForwardingNode.nextTable links. Aren't nextTable
>> links supposed to be only in "forward" direction, leading to from smaller to
>> larger tables?
> 
> They aren't required to be -- to preserve nonblockingness of traversal,
> they can revert to old versions of table. This is legal but disconcerting
> and surprising. I now think that giving up on pure non-blockingness
> (only in the case of concurrent resizes) and helping to transfer
> (which can block), thus forcing monotonicity,  is  a better policy.

OK.


> An update is forthcoming. (Thanks to Paul for finding a use case
> leading to this better policy!)
> 

I can't take credit for that. 

The test code i pasted was slightly modified version of a JDK test written a while ago by Martin and which has recently been intermittently failing. I just tweaked that test to increase the probability of failure.

Paul.


More information about the core-libs-dev mailing list