A customized implementation of java.util.HashMap
designed to operate in a multithreaded environment where the large majority of method calls are read-only, instead of structural changes. Read calls are non-synchronized and write calls perform the following steps:
- Clone the existing collection
- Perform the modification on the clone
- Replace the existing collection with the (modified) clone
NOTE: If you are creating and accessing a HashMap
only within a single thread, you should use java.util.HashMap
directly (with no synchronization), for maximum performance.