[erlang-questions] Does erlang:now() guarantee that subsequent calls to this BIF returns continuously increasing values even in erlang cluster?

Sergej Jurečko <>
Mon Apr 20 09:16:54 CEST 2015


You could use something like this: <<Now:64, ServerIndex:8>>
and assign an index to every server.


Sergej


On Mon, Apr 20, 2015 at 9:06 AM, Daniel <> wrote:

> If so, is there any method that can get unique values in cluster? I prefer
> time based unique values if there is any.
>
> > On Apr 20, 2015, at 2:44 PM, Sergej Jurečko <>
> wrote:
> >
> > It does not guarantee unique values in cluster.
> >
> > Sergej
> >
> > On Apr 20, 2015 8:42 AM, "Daniel" <> wrote:
> > Hi, dear list,
> >
> > I am looking for a global sequence generator in erlang cluster.
> >
> > I think erlang:now() is promising, because it is fast enough and “also
> guarantees that subsequent calls to this BIF returns continuously
> increasing values”. But I am not quite sure whether this guarantee also
> works for erlang cluster which have several nodes running on different
> servers?
> >
> > I have read Time and time correction in Erlang (
> http://www.erlang.org/doc/apps/erts/time_correction.html), but still have
> no conclusion.
> >
> > Daniel Liu
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150420/908fc3b0/attachment.html>


More information about the erlang-questions mailing list