[erlang-questions] Shared ETS Access

Ulf Wiger <>
Mon Jan 11 13:17:44 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jachym Holecek wrote:
> 
> 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...

If you look at gproc,

http://svn.ulf.wiger.net/gproc/branches/experimental-0906/gproc/src/gproc.erl

you can see (after deciphering some of the extra complexity) how name
lookups are done in the calling process (gproc:where/1), whereas
registrations are done in the central gen_server.

For registrations, properties (where only the {Name,Pid} pair is
unique, and processes can only register their own properties), can be
written directly from the calling process, whereas unique names must
be written in the central gen_server process.

BR,
Ulf W
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktLFugACgkQtqqFieqzed1GnwCfUj+DmhcP8I1VRDpqXSLgS+kA
wXQAn08ASJT9YdQwJS1yMED5RDh7ZnED
=liuR
-----END PGP SIGNATURE-----
---------------------------------------------------

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

WE'VE CHANGED NAMES!

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

www.erlang-solutions.com



More information about the erlang-questions mailing list