[erlang-questions] What happens with atoms across different systems?
Sat Jun 15 17:46:04 CEST 2013
Sending the message will create the atom on the other side if it doesn't
already exist. The semantics of how long it sits in the receiver's mailbox
depends only on the code running in that process.
On Saturday, June 15, 2013, Yves S. Garret wrote:
> 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
> 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
> will sit in the receiving thread's queue until it can recognize it or can
> handled/thrown away?
> As a follow-up question, does it make sense to use atoms in this fashion?
> Thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions