[erlang-questions] Lockfree now()
Erik Søe Sørensen
Thu Jul 12 19:27:33 CEST 2012
2012/7/12 Wojtek Narczyński <>
> On 07/12/2012 02:58 PM, Erik Søe Sørensen wrote:
> When I implemented now() in Erjang, I found a lock-free algorithm for it
> which has the right "timestamp must be monotonically increasing" property.
> " It is also guaranteed that subsequent calls to this BIF returns
> continuously increasing values."
> I don't think your solution quarrantees this.
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?
> It can be implemented with N-bit CAS for N-bit time value.
> Wojtek Narczynski
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions