Please help me use/create Concurrent LinkedHashMap in multithreaded architecture.
As per my belief, if I use Collections.synchronizedMap(), I would have to use synchronized blocks for iterator. Would this implementation lead to sequential addition of elements
If I use ConcurrentSkipListMap<String,String>
is there any way to implement a Comparator to store sequentially, as stored in Linked List or queue.
I would like to use java's built in instead of third party packages.
Thanks
EDIT:
In Concurrent LinkedHashMap, the keys are the name, I wish to put the keys in sequence of their arrival. i.e. new value would be appened to either at start or end, but sequentially.
while iterating, the LinkedHashMap could be added with new entries, or removed. but the iteration should be follow the seqence in which the entries were added.
I understand that by using Collections.synchronizedMap(), an synchronized block for iteration would have to be implemented, but would the map be modifiable (entries could be added/removed) while it is being iterated.