[erlang-questions] Shared ETS Access

Robert Virding <>
Mon Jan 11 19:55:31 CET 2010


2010/1/11 Jachym Holecek <>

> # Zoltan Lajos Kis 2010-01-11:
> > Is there any advantage in writing to the table through a server process,
> > instead of directly writing to the table (perhaps using the
> > write-concurrency switch) ?
>
> [Answering the general question, didn't track the thread closely.]
>
> Depends on the problem at hand. Writing through owner process implies table
> modifications are serialized in time, this is useful in cases where table
> holds data complex beyond a simple key-value store or when table contents
> need to stay in sync with some bits of surrounding world. So "consistency"
> or at least illusion thereof is the answer.
>
> Of course, one remembers to think twice before using ETS acrobatically ;-).
>

You have exactly the same problem if you want to do a number of reads which
are considered to be atomic. In many ways ETS provides a low-level interface
and often you will need to add a layer above it. This is not a bug but
definitely a feature and is in accord with a basic principle we had of
providing tools rather than solutions.

Robert


More information about the erlang-questions mailing list