I've read
http://www.javamex.com/tutorials/synchronization_concurrency_8_hash...
I'm wondering what the best and most performant option is given that my HashMap will be read intensively by multiple threads whereas it will be only sporadicaly (once every day/week) reloaded by one thread ?
That is, at (web) application startup, I load the Map. After application startup, requests start arriving using that map to check the existence of a particular key, and if so, to fetch the value (object) behind the key and associate it to the object I' m processing.
In the ideal situation I want to block those reading threads until the whole Map is fully-reloaded. How can I accomplish that given that the reloading will only occur by one thread, once in a while ?
If the ideal is not possible would ConcurrentHashMap be an option ?
Thanks,
E