Unsafe.{get|set}Opaque should be single copy atomic

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P2
    • 9
    • Affects Version/s: None
    • Component/s: hotspot
    • None
    • b120

      Current C2 intrinsic code makes Opaque a "relaxed" plain load/store with regards to single copy atomicity.

        bool requires_atomic_access = false;
        switch (kind) {
            case Relaxed:
            case Opaque:
                requires_atomic_access = AlwaysAtomicAccesses;
                break;

      This contradicts the intent of making Opaque similar to std::atomic...(..., memory_order_relaxed), which is single copy atomic.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: