Add Atomic<T>::compare_set

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: hotspot
    • None

      Following up on JDK-8367013 improvement, there is an opportunity to rewrite some of our low-level `cas(oldv, newv) == oldv` patterns to more straight-forward compare-and-set helper method. This is useful when you do not actually care about the result that used to be in memory or that is currently in memory.

      Java atomics already have this distinction; arguably due to historical timeline of having compare-and-set before introducing compare-and-exchange.

      Found this when converting Epsilon to Atomic<T> (JDK-8374876), where this method would simplify the code a bit.

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

              Created:
              Updated: