8179527: Ineffective use of volatile hurts performance of Charset.atBugLevel()
shade at redhat.com
Tue Jun 27 06:58:56 UTC 2017
On 06/27/2017 08:50 AM, Langer, Christoph wrote:
> So, waiting for comments from other experts...
>> Webrev: http://cr.openjdk.java.net/~horii/8179527/webrev.00/
This patch is fine as stated.
Without volatile, there is a benign data race on the bugLevel field, which is
okay, assuming "sun.nio.cs.bugLevel" never actually changes. Doing
double-checked-locking seems excessive here, because we can accept more than one
invocation of privilegedGetProperty.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the nio-dev