Say I have two
HashMap in Java, or
Dictionary in C#), A and B. I want to synchronize B to A, so that B is a copy of A. I can't copy the reference and I don't want to delete all keys and re-add; I want to keep B available and mostly accurate during processing. What's the most efficient algorithm to do that?
I'm looking for a general algorithm to do cache synchronization, while keeping the second cache available. This seems to be the same as dealing with maps.