Why Data is needed in ets heir?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Why Data is needed in ets heir?

yuzhu chen
When setting up ets heir, I found "HeirData" is included in the heir option {heir,Pid,HeirData}, I'm confused why it is needed. Can anyone tell me the reason of it? Is there any direct way to setup ets heir when the ets table is created?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Why Data is needed in ets heir?

Jesper Louis Andersen-2
Hi,

When an ETS table is given away through an heir, the receiving process (of the ETS table) receives a message of the form

{'ETS-TRANSFER',tid(),FromPid,HeirData}

The `HeirData` field allows you to send auxiliary information through to the heir when the transfer happens. For instance some information about the ETS table in question. Usually heir-transfer happens when a process crashes, so you may not get a chance to send extra information through a normal message. Furthermore, you would have to align two messages to each other in the recevier which tend to be more complicated.
 

On Sun, May 21, 2017 at 1:05 PM yuzhu chen <[hidden email]> wrote:
When setting up ets heir, I found "HeirData" is included in the heir option {heir,Pid,HeirData}, I'm confused why it is needed. Can anyone tell me the reason of it? Is there any direct way to setup ets heir when the ets table is created?
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...