Re: Is SharedSecrets thread-safe?

2020-12-31 Thread some-java-user-99206970363698485155
Hello Peter, the changes look good, however there might be more to consider: - `jdk.internal.access.SharedSecrets.getJavaLangRefAccess()` Might be good to add a comment there or for `java.lang.ref.Reference` that it is (hopefully?) initialized during JVM start-up. Similar to the comment for

RFR: 4926314: Optimize Reader.read(CharBuffer)

2020-12-31 Thread Philippe Marschall
Implement three optimiztations for Reader.read(CharBuffer) * Add a code path for heap buffers in Reader#read to use the backing array instead of allocating a new one. * Change the code path for direct buffers in Reader#read to limit the intermediate allocation to `TRANSFER_BUFFER_SIZE`. *

Re: RFR: 4926314: Optimize Reader.read(CharBuffer)

2020-12-31 Thread Philippe Marschall
On Thu, 31 Dec 2020 10:10:56 GMT, Philippe Marschall wrote: > Implement three optimiztations for Reader.read(CharBuffer) > > * Add a code path for heap buffers in Reader#read to use the backing array > instead of allocating a new one. > * Change the code path for direct buffers in Reader#read

Re: Is SharedSecrets thread-safe?

2020-12-31 Thread Peter Levart
On 12/31/20 2:30 AM, Hans Boehm wrote: It sounds as though this would be correct if if (static_field == null) { initialize(); } return static_field; ``` were rewritten as Foo my_local_copy = static_field; if (my_copy == null) { initialize(); my_local_copy = static_field; } return

RFR: 8259021 avoid double racy reads from non-volatile fields of SharedSecrets

2020-12-31 Thread Peter Levart
See: https://bugs.openjdk.java.net/browse/JDK-8259021 See also discussion in thread: https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-December/072798.html - Commit messages: - 8259021 avoid double racy reads from non-volatile fields of SharedSecrets Changes: