Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160710

Enable Thread to grant VarHandle field access to ThreadLocalRandom/Striped64

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None

      Backports

        Description

        The work to replace Unsafe with VarHandles with JDK-8080603 has resulted in good consolidation of the remaining Unsafe dependencies, specifically those where Thread's fields need to be accessed by ThreadLocalRandom and Striped64.

        Aa Peter Levert shows it's possible to leverage SharedSecrets:

        http://cr.openjdk.java.net/~plevart/misc/JavaLangThreadAccess/webrev.Striped64/

        which exposes VarHandles to the Thread's appropriate fields. AN alternative is to expose Thread's Lookup in controlled manner to specific classes.

        A concern is this approach may cause start-up circularities so should be investigated and tested carefully.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                psandoz Paul Sandoz
                Reporter:
                psandoz Paul Sandoz
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: