@ Tunaki answered the question expertly, but there is another problem that affects the choice.
To add to a cell, a cell for each stream is required. The internal code uses getProbe () in Striped64, which returns:
returns UNSAFE.getInt (Thread.currentThread (), PROBE);
A probe is a system field used in threadLocalRandomSeed.
I understand that the probe is unique for each thread. If you have a large number of create / destroy threads, then a probe is created for each new thread.
Consequently, the number of cells may become excessive. If anyone has more details about this, I would love to hear from you.
source share