RFR 4641897: Faster string conversion of large integers

Aleksey Shipilev aleksey.shipilev at oracle.com
Fri Jun 21 15:36:51 UTC 2013

On 06/21/2013 07:04 PM, Brian Burkhalter wrote:
> On Jun 21, 2013, at 2:49 AM, Alan Bateman wrote:
>> One part that might need attention is getRadixConversionCache as I
>> could imagine cases where the synchronization could lead to
>> contention. Have you (or Alan) considered alternatives that would
>> limit the synchronization to only when the powers cache needs to be
>> expanded?
> I have not but will do so. I cannot speak for Alan E.

That's actually quite straight-forward. Make the list immutable, put it
into the volatile reference; count the current size in volatile field.
You can then try to resize the cache concurrently by generating the new
list, and assigning it to the volatile reference. Since the resizes are
not frequent, you don't care if you compute multiple candidates with
multiple threads.


More information about the core-libs-dev mailing list