[erlang-questions] Lockfree now()

Wojtek Narczyński wojtek@REDACTED
Thu Jul 12 19:52:09 CEST 2012


On 07/12/2012 07:27 PM, Erik Søe Sørensen wrote:
> Why not? That's certainly the intention of the last part; latest_now 
> should always be updated in a increasing manner, and the return value 
> of ensure_monotonically_increasing_now() should always be equal to the 
> new value of latest_now.
> Did I make a mistake?

Well, how do you "ensure" it without taking a lock? Meanwhile the global 
value can be increased by another thread, to what you calculate locally.

--Regards,
Wojtek



More information about the erlang-questions mailing list