-2

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.

Tarun
  • 3,162
  • 3
  • 29
  • 45
  • 1
    clone is a duplicate of the ConcurrentHashMap. But Snapshot is creating new instance and add all form original map to new one. have a look of: https://stackoverflow.com/questions/37782319/java-how-to-take-static-snapshot-of-concurrenthashmap – janith1024 Aug 22 '17 at 09:55

1 Answers1

0

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"

F0rG0tTeN
  • 96
  • 7