[erlang-questions] unique_integer

Guilherme Andrade g@REDACTED
Mon Apr 4 01:18:09 CEST 2016


On 02/04/16 21:32, mickael trouve wrote:
> Why does the step of the unique integer is 2 ? What about the odd values ?

By doing a quick test using 18.2.1, a naïve analysis points to 1) the
step being proportional to twice the number of online schedulers and 2)
things getting fuzzier when trying to generate integers concurrently.

I would speculate that maybe separate counters are kept for different
schedulers in order to not have that as a bottleneck, and hence a step
that's proportional to the number of counters (as well as adequate
initial values) in order to avoid repetition.

Or maybe it's something else entirely.


PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160404/eb4a38c0/attachment.bin>

More information about the erlang-questions mailing list