[erlang-questions] ei, erlang_interface, creation and deprecation

Peter Andersson <>
Tue Sep 4 16:23:19 CEST 2007


Hi Jeff,

You choose the creation value yourself. There's no right or wrong way to
do it. The problem the creation value is meant to solve is this: If a C
node restarts and registers with the same node name, processes on the
new node could be receiving messages that were sent to processes on the
old node (if the identities/names of the processes are the same). If a C
node is assigned a new creation value after restart, you can use this to
verify that messages are really meant to be received by the current
instance of the node. If you know this scenario can never happen in your
system, you can "just set the creation to 0 and move on" as you've seen
in the examples.

Erl_interface isn't deprecated, but we always recommend the use of ei
rather than erl_interface. The reason being that ei is more flexible and
efficient. Erl_interface is perhaps more convenient to work with
(slightly higher level), but ei is still the better interface. It's very
unfortunate that the manual doesn't point out these things clearly (*)
and I agree that since we recommend using ei, there really should be a
user's guide. (For now, users have to read the erl_interface guide and
translate the examples from erl_interface to ei). To give the docs some
love and updates is on our to-do-list.

(*) On the ei lib reference page: "The difference between |ei| and
|erl_interface| is that |ei| uses the binary format directly when
sending and receiving terms. It is also thread safe, and using threads,
one process can handle multiple C-nodes".

Peter

Ericsson AB,
Erlang/OTP


Jeff Hodges wrote:
> Hey all,
>    I've gone through the archives, but the search seems to be  
> broken.  I have two questions both concerning the ei library.
>
>    The first question is, how should I be calculating the creation  
> short that is passed to ei_connect_init (or erl_connect_xinit)?  All  
> of the code I've seen "in the wild" just set it 0 and move on, but  
> the docs claim its used in case of node name collisions.  So, what's  
> the "right way" to get the creation number?
>
>    The second is, is erl_interface still deprecated? I found a post  
> from long ago[1] that mentioned that, but later ones mention that it  
> and ei would be getting "cleaned up".  None of the docs mention any  
> of this.  And the docs do not mention ei, much at all (no User Guide,  
> for instance).  I assume that the docs are just out of date and  
> needing some love?
>
>    Thanks for the help.
>
> [1]  http://erlang.org/pipermail/erlang-questions/2003-August/ 
> 009527.html
> --
> Jeff
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
>   




More information about the erlang-questions mailing list