Re: [h2] Why MVMap's public V get(Object key) is not synchronized

2017-06-09 Thread Michael Wu
Hi, I didn't notice that MVMap implements ConcurrentMap. Now, I feel confident to use it. Actually, I think the MVStore library is useful in many use cases. Appreciate your help! Michael Wu Thomas Mueller Graf於 2017年6月10日星期六 UTC+8上午12時08分46秒寫道: > > Hi, > > The get method is thread-safe. The

Re: [h2] Why MVMap's public V get(Object key) is not synchronized

2017-06-09 Thread Thomas Mueller Graf
Hi, The get method is thread-safe. The MVMap implements ConcurrentMap which implies thread-safety. Thread-safe method doesn't need to be synchronized. For example, String.hashCode is not synchronized, but is thread-safe. Regards, Thomas On Friday, June 9, 2017, Michael Wu

[h2] Why MVMap's public V get(Object key) is not synchronized

2017-06-09 Thread Michael Wu
Hi, I am learning to use the MVMap class. I read the source code and found that the following methods are all synchronized except the get(...) method: public synchronized V put(K key, V value) public synchronized void clear() public synchronized V putIfAbsent(K key, V value) public synchronized