[concurrency-interest] CHM trySplit of a map with odd size
paul.sandoz at oracle.com
Mon Feb 22 10:44:45 EST 2016
> On 22 Feb 2016, at 16:04, Doug Lea <dl at cs.oswego.edu> wrote:
> On 02/22/2016 04:33 AM, Ben Manes wrote:
>> When writing parameterized tests
>> a custom Spliterator view, the tests failed for maps of size 1.
>> ConcurrentHashMap trySplit will return a new Spliterator with an estimated size
>> of zero and set the source spliterator to zero as well.
> I believe that plain HashMap and some other classes can do this as well.
HashMap does, you are faster than me in replying :-)
> They return regions that should (statistically) hold elements but might not.
e.g. in the case of certain maps, the entry table is split in two and we don’t know which half of the table the single entry resides.
> Similarly for some IO-based spliterators.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the Concurrency-interest