In more detail:
As far as I know, ConcurrentHashMap does not make any statement about the 
order of the elements. Two Phase Locking relies on the order of locks to 
avoid dead locks. Thus, if you have many concurrent processes on the same 
variables and you use a non ordered map for log, you may experience dead 
locks. Furthermore, if you use ConcurrentHashMap, you have overhead for 
synchronization, as the TransactionLog does not need to be synchronized 
because it is thread local. The methods of the TransactionLog will never be 
called concurrently.

Sorry for the long delay and the first sketchy answer.

Am Montag, 8. Juli 2019 21:20:28 UTC+2 schrieb V:
>
> The log must be ordered to make the Two Phase Locking work correctly. The 
> method putIfAbsent should be rebuild in the TransactionLog locally to 
> make it downwards compatible with older Java library versions.
>
> Am Montag, 8. Januar 2018 10:26:12 UTC+1 schrieb zhou...@163.com:
>>
>> I've tryed SillyClock on android and works but when I proceed to more 
>> complex transaction involving both writeTVar and orElse, the App crashed 
>> because putIfAbsent was not implemented, so I replace java.util.Map to 
>> java.util.ConcurrentHashMap and it works again
>>
>>
>> <https://lh3.googleusercontent.com/-xfz1D7v_G2s/WlM4_OdcztI/AAAAAAAAABc/7cqTzbOJ20YwxQaeHDoTK6W09IdMLEs5QCLcBGAs/s1600/my1.png>
>>
>>
>> <https://lh3.googleusercontent.com/-o8xF1fZt9ok/WlM5HIRlcAI/AAAAAAAAABg/NUCcJo5HZ7EdlF_FlOjwotHUYUyOwzebACLcBGAs/s1600/my2.png>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Frege Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to frege-programming-language+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/frege-programming-language/3809ad0a-24eb-4e1e-b3ee-fed94fd9d52c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to