[erlang-questions] Shared ETS Access
Mon Jan 11 12:48:15 CET 2010
# Zoltan Lajos Kis 2010-01-11:
> > [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
> > ;-).
> This will only become consistent if reads are also done through the
> server. But then the table could be set to private as well (if an ets
> table is needed at all then).
No, "it will only pass if reads are done _carefully_" is more like it.
You'd probably hide all the raw ETS manipulation behind the API of your
module, so you're free to employ some particular access protocol and
there are assumptions you could make.
Pity I can't point at some opensource example of this sort of thing...
More information about the erlang-questions