8179527: Ineffective use of volatile hurts performance of Charset.atBugLevel()

Aleksey Shipilev 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...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170627/2b490e8f/signature.asc>

More information about the nio-dev mailing list