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

Enable Thread to grant VarHandle field access to ThreadLocalRandom/Striped64

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • None
    • core-libs
    • None

        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.

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

                Created:
                Updated:
                Resolved: