ets concurrency

Ulf Wiger ulf.wiger@REDACTED
Thu Jan 29 18:03:24 CET 2004


On Thu, 29 Jan 2004 17:41:11 +0100, Joachim Durchholz 
<joachim.durchholz@REDACTED> wrote:

> Ulf Wiger wrote:
>
>> There is some support for avoiding a rehash while iterating over an ets 
>> table. This is used by the ets:foldl and ets:foldr functions, but
>> there is no table locking per se.
>
> How does mnesia ensure ACID properties, if it can't rely on ETS?
> I imagine one shouldn't directly access the ETS tables of mnesia, but
> I'd like to know for sure :-)

Mnesia has its own transaction manager, using a two-phase commit
protocol with deadlock prevention. It also allows direct access
to the tables at two different levels:

- "dirty write": indices and replicas are updated; works on both
   local and remote tables, as well as on persistent tables
- "ets insert": only works if the table has a local ram copy,
   no indexing, no replication, but is of course blindingly fast.

Both "dirty" and "ets" operations completely subvert the
transaction manager, and have to be used with great care.

/Uffe
-- 
Ulf Wiger, Senior System Architect
EAB/UPD/S



More information about the erlang-questions mailing list