Potential issue with CHM.toArray

Doug Lea dl at cs.oswego.edu
Thu Aug 29 11:44:48 UTC 2013


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.
An update is forthcoming. (Thanks to Paul for finding a use case
leading to this better policy!)

-Doug




More information about the core-libs-dev mailing list