Do I need a ConcurrentHashMap in Java for this case:
Before, passing the HashMap to a bunch of threads, I initiate the map with all the keys necessary:
Key = "thread1Key", Value = null
Key = "thread2Key", Value = null
Key = "thread3Key", Value = null
...
Each task is part of a Runnable (executed by a thread) and is assigned to alter the value of ONLY 1 of those keys. It's preassigned. In other words, I don't need to worry about the case where multiple Runnables may alter the same key in the hashmap.
In this case is ConcurrentHashMap required or a regular HashMap would do? And why?
Thanks!