Enable Thread to grant VarHandle field access to ThreadLocalRandom/Striped64

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: None
    • Component/s: 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.

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

                Created:
                Updated:
                Resolved: