20 April 2019
Java ConcurrentHashMap
by Jerry Zhang
#Tip of the Day: 不积跬步,无以至千里;不积小流,无以成江海。
Why use ConcurrentHashMap?
HashMap: In multi-threads environment, HashMap is not secure. No protection, 100% forbidden!
HashTable: use synchronized to secure concurrency, but efficiency is poor. This is because it locks the whole table with only one key.