Hi i know the workings of ConcurrentHashMap
before JDK 8.
I also understood the code: it was pretty modular and not very hard to understand.
The code of ConcurrentHashMap
in JDK 8 has changed a lot from its previous implementations.
Because this question was classified as too broad I will now try to be very specific.
CHMv8 uses a TreeBin (a variant of RedBlackTree) for buckets rather than a linked list.
So my question what is the main advantage of using TreeBin over a linked list?