EnhancedNodeCache - the cache to use for enhanced nodes (mapping a Node
to one of the enhanced nodes it can represent).
The cache methods do not need to be synchronised. Java guarantees that
access/update of reference values is atomic. The get method
does a single read operation of the cache, and then checks that the
returned element matches the key, only returning legal objects; changes
to the cache subsequently don't affect the correctness of the result.
The put method updates the appropriate cache entry as
a one-shot deal. gets on different slots don't matter. Gets on the same
slot have either completed (and thus don't care about the change) or
are about to happen (and will be equally happy with the old or new
value).
Synchronisation *is* required when updating the EnhNode sibling ring,
but that doesn't happen here.
author: kers |