简体   繁体   中英

Erlang shared ETS tables

Can the Erlang ETS tables be shared among different processes? Thus, if I have two processes running on different Erlang running systems, can I somehow link them so that all the changes I do in one ETS table will be reflected in the other?

Within a single Erlang node, ETS tables can be fully shared by passing the public option to ets:new . (Beware that the table will be destroyed if its owner dies, though, unless you have set up an heir.)

If you need to share tables across several Erlang nodes, you need to use Mnesia.

You cannot "share" an ETS table between processes on different nodes, an ETS table is only accessible by processes on the node on which it was created. If you want to share ETS tables then you will need create a process on one node, the node with the table, and access the table from the other node through this process. It is not really that difficult.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM