[erlang-questions] ownership of an ets table
Scott Lystig Fritchie
Fri Nov 5 18:10:46 CET 2010
Morten Krogh <mk@REDACTED> wrote:
mk> Ahmed, the reason I singled out public tables was because tables
mk> with public access might naturally live without an owner. Private
mk> tables are pretty useless when their owner dies, but public tables
mk> could be on their own, I would say.
"Naturally" is in the eye of the beholder. I'd want to have such a
public ETS table go away the moment that I stopped the OTP application
that was using it. As a thought experiment: pretend that your virtual
machine (and all applications & processes that run within it) will be
running for 10 years.
mk> One could have an option in the ets:new to create a table without an
mk> owner. Why not?
It's pretty common to create a public table in a supervisor's init()
function. The supervisor won't die unless its application (or at least
its parent supervisor) is stopped.
More information about the erlang-questions