RFR: 8261445: Use memory_order_relaxed for os::random().

Andrew Haley aph at openjdk.java.net
Tue Feb 9 15:06:10 UTC 2021


os::random() is used a lot (once for every class) during HotSpot initialization, and it defaults to using a compare-and-swap operation with memory_order_conservative. We don't need that: it should be memory_order_relaxed.

-------------

Commit messages:
 - Stage

Changes: https://git.openjdk.java.net/jdk/pull/2484/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2484&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261445
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2484.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2484/head:pull/2484

PR: https://git.openjdk.java.net/jdk/pull/2484


More information about the hotspot-runtime-dev mailing list