[erlang-questions] What happens with atoms across different systems?

Yves S. Garret <>
Sat Jun 15 15:57:20 CEST 2013


Hello,

I'm reading the book Erlang and OTP in Action and came across this part:
"In Erlang, an atom is a special kind of string constant that is identified
only by the
characters in the string, so that two atoms are always considered to be
exactly the
same if they have the same character representation. But internally, these
strings
are stored in a table and are referred to by the table index, so that
checking atoms
for equivalence at runtime amounts to comparing two small integers; and
each time
you use an atom, it takes up only one word of memory. (The index number
used for
any particular atom is automatically assigned at runtime and can vary from
one run
of the system to the next; there is no way, and no need, for the user to
know this.)"

Now, this got me thinking.  What if I have two systems that send messages
to one
another.  I update one and include a new atom that I'm using.  This atom
gets sent
to system #2 that cannot recognize it just yet.  Does that mean that that
message
will sit in the receiving thread's queue until it can recognize it or can
be
handled/thrown away?

As a follow-up question, does it make sense to use atoms in this fashion?

Thanks in advance,
--Yves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130615/24121c4b/attachment.html>


More information about the erlang-questions mailing list