RFR: 7113878: LogManager - namedLoggers should be ConcurrentHashMap instead of Hashtable
Mandy Chung
mandy.chung at oracle.com
Mon Mar 30 17:10:43 UTC 2015
On 3/30/2015 10:03 AM, Daniel Fuchs wrote:
> On 27/03/15 22:47, Mandy Chung wrote:
>> On 3/27/15 4:27 AM, Daniel Fuchs wrote:
>>> Here is a new webrev - with Peter's suggestion implemented.
>>> I also made a few tweaks to the test.
>>>
>>> http://cr.openjdk.java.net/~dfuchs/webrev_7113878/webrev.01/
>>
>>
>> This version looks good to me. With this change to use CHM,
>> we could modernize the code further and that's for some other day.
>
> Thanks Mandy.
>
>> I think the removeLoggerRef andgetLoggerNames method don't
>> need to be synchronized either - any reason why they are
>> kept synchronized?
>
> Yes. getLoggerNames() calls ensureInitialized().
> There may be a possibility to improve synchronization
> there too but that will be more complex.
>
>
> removeLoggerRef is already called from within a
> synchronized block on LoggerContext - so there is nothing
> to gain here.
I am aware of that while that synchronize is needed for updating the
nodes. As synchronized on removeLoggerRef isn't needed, I'd prefer it
be taken out.
Mandy
More information about the core-libs-dev
mailing list