Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8080588 VarHandles development
  3. JDK-8156068

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

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b120

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: