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

Enable Thread to grant VarHandle field access to ThreadLocalRandom/Striped64

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 9
    • core-libs
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: