[erlang-questions] Unique references

Vance Shipley vances@REDACTED
Fri Aug 8 18:56:31 CEST 2008

I find it odd that in the recent thread about unique references
no one has mentioned the native erlang reference data type:


I have heard it said that a ref() is not as sure to be unique as
it should be.  If that is the case shouldn't it be fixed?  Since
it is to be an opaque value it shouldn't break anything if it is

   (foo)1> make_ref().

The documentation says:

   "A reference is a term which is unique in an Erlang runtime system"

I believe it is actually unique in a distributed Erlang system as well:

   (bar)1> global:register_name(bar, self()).

   (foo)2> global:send(bar, R).

   (bar)2> receive R -> R end.

The "5737" is the node part.

The problem with the ref() is that it isn't unique across instances
of an erlang runtime system:

   1> make_ref().

   1> make_ref().

Why don't we just fix this?


More information about the erlang-questions mailing list