Tarun Tarun - 1 month ago 17
Java Question

Snapshot vs Clone in ConcurrentHashMap

Could someone please highlight the different between "Snapshot" vs "Clone" in the context of ConcurrentHashMap.

How a snapshot iterator different from an iterator that iterates over the copy of underlying data-structure.

Answer Source

I guess you are just confused between those two name. Basically they are the same thing. Any iterator will contain a definite state of the collection/maps , so the name is only different but working will be the same. Though here can be different ways to implement those iterators having performance impacts . Please refer here "http://www.javamex.com/tutorials/synchronization_concurrency_8_copy_on_write.shtml"