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.
More information about the core-libs-dev