Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1024

DataTree state management does not require volatile

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 4.0.2
    • data-impl
    • None

    Description

      With JDK9+ we get more fine-grained memory model, hence we can go in between ordinary and volatile access.

      InMemoryDataTree.state publishing is an area where we publish an effectively-final object, hence under safe publishing we can not order against all other volatiles if we use acquire/release locking. This helps JIT a bit, as it gives it more freedom to reorder memory access.

      Use VarHandles to implement this, so that we do not use volatile access.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: