Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901989

Use VarHandles Opaque mode instead of volatile checks

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P3
    • None
    • None
    • tools
    • None
    • jmh

    Description

      On some architectures, volatile reads come with the associated performance costs. We need to see if VarHandles Opaque mode fits better for "isDone" flag checks, and around the Blackholes. This might drop down the lower time bound for the measurable effects on those platforms.

      Caveats:

      We want to break optimizations *across* isDone checks, i.e. between separate @Benchmark calls. Right now we are somewhat saved by having the non-counted loop that would not be unrolled. As implemented now, Opaque does not suffer from this, because it just emits the CPUOrder barriers around the access. But we have to wonder if careful optimization would be able to enforce the subordering only for non-plain accesses.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: