From what I understand, a parallel hash map from Java 5 onwards gives you a hash map with a stream that does not use blocking access for iterators and updates (if the concurrency level is sufficient).
Given the following conditions:
- Insertions are performed only once (during application initialization).
- Each thread receives a set of keys for insertion that are not shared by any other thread.
- Updates never happen.
- Elections are made only after application initialization is complete.
Would I be better with simple hash maps?
I understand that I will probably be better, because my keys will not collide - I can guarantee this. But is it possible that the Java implementation will introduce errors in the hash buckets, for example, assigning the same bucket to two different keys?
java hashmap concurrency
Apoorv khurasia
source share