[erlang-questions] compare and set semantics using ets?
Tue Jan 15 11:52:03 CET 2013
Why are you speaking about some CAS instructions, when you just need API in
ets module: insert_or_replace
On Tue, Jan 15, 2013 at 1:41 PM, Anton Lebedevich <> wrote:
> On 01/14/2013 07:13 PM, Anton Lebedevich wrote:
> > On 01/14/2013 07:01 PM, Jesper Louis Andersen wrote:
> >> On Jan 14, 2013, at 1:08 PM, Anton Lebedevich <> wrote:
> >>> Is it possible to implement atomic compare-and-set semantics using ets?
> >> Only in a limited fashion. I guess we either need a specific
> CAS-instruction, or you have to look up how it is achieved in mnesia, which
> does to transactional updates.
> > Good catch, I've completely forgot that mnesia already does it, will
> > take a look at its sources.
> Reading mnesia sources revealed that it uses transaction manager and
> locker processes to serialize modification operations.
> Mnesia transactions rely on making modifications sequential not on
> It turns out that CAS which is a workhorse of many non-Erlang concurrent
> libraries isn't available in Erlang without NIFs. Am I missing something?
> Anton Lebedevich.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions