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 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 <mwu...@gmail.com <javascript:>> 
> wrote:
>
>> 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 boolean remove(Object key, Object value)
>> public synchronized boolean replace(K key, V oldValue, V newValue)
>> public synchronized V replace(K key, V value)
>>
>> Looks it is not thread safe to use the get(...) method:
>>
>> public V get(Object key)
>>
>> Is this an error?  Can anyone help?
>>
>> Thanks in advance!
>> Michael
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to h2-database+unsubscr...@googlegroups.com.
>> To post to this group, send email to h2-database@googlegroups.com.
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to