Answer the question
In order to leave comments, you need to log in
Does it make sense to use ConncurrentHashMap instead of HashMap if it's read-only?
There is a small Map, 10 positions, it is initialized during creation, then it does not change.
It is used very often, in different threads.
Does it make sense to use ConncurrentHashMap instead of HashMap?
Answer the question
In order to leave comments, you need to log in
No. Reading does not change the state of the map in any way, so there is no need to worry about thread safety
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question