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

Evans, Matthew mevans@REDACTED
Fri Apr 16 18:06:59 CEST 2010


I wonder if it would be possible to use global:trans and have the ResourceId set to the name or identifier of the ETS table (and LockRequesterId as the calling processes pid)?

Performance might be a dog however....

-----Original Message-----
From: erlang-questions@REDACTED [mailto:erlang-questions@REDACTED] On Behalf Of Ulf Wiger
Sent: Friday, April 16, 2010 11:40 AM
To: Pablo Platt
Cc: erlang-questions@REDACTED
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:

http://www.erlang.org/pipermail/erlang-questions/2007-June/026998.html

BR,
Ulf W
-- 
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
http://www.erlang-solutions.com
---------------------------------------------------

---------------------------------------------------

WE'VE CHANGED NAMES!

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

www.erlang-solutions.com


________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED



More information about the erlang-questions mailing list