[erlang-questions] atomic read+delete operation on ETS record

Pablo Platt <>
Sat Apr 17 12:16:05 CEST 2010

>From you old post I understand that this need to be done as a BIF.
Is there a c file I can see for reference so I can play with it and contribute?

From: Ulf Wiger <>
To: Pablo Platt <>
Sent: Fri, April 16, 2010 6:39:39 PM
Subject: Re: [erlang-questions] atomic read+delete operation on ETS record

Pablo Platt wrote:
> ETS has atomic operations like update_element and update_counter.
> Is there a way to read a record and delete it in the same operation without using a gen_server that manage the table?
> Is there a way to update a list inside a record in an atomic way?
> For example, mongodb and redis let you add and remove items from the beginning and end of lists.
> ETS records are Erlang terms so it might be possible and will be very useful.

I did a dirty hack 3 years ago trying to increase the number of things
that could be done atomically with ets:


Ulf W
-- Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd



Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.



More information about the erlang-questions mailing list