Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260664

Phaser.arrive() memory consistency effects

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:

      Description

      Petr Janeček wrote on concurrency-interest:

      Hello,
      I've been using Phaser a lot recently. It's very fast and works
      great overall. Thank you.

      That said, whenever I use it I feel slight guilt and a fear that
      my usage might break in the future. I can see the OpenJDK code
      and the current implied memory consistency effects, however I
      cannot see them stated anywhere in the docs.

      The package JavaDoc says:
      > Actions prior to calling [...] Phaser.awaitAdvance (as well as
      > its variants) happen-before actions [...] subsequent to a
      > successful return from the corresponding await in other threads
      This is OK.

      However, I cannot find any information about the arrive() method,
      or the effects of getPhase(). Because some of my threads do want
      to wait while the others sometimes don't, they simply want to
      publish a write (or read shared state) and move on without
      waiting.

      Would you please consider specifying the memory consistency
      effects of Phaser in greater detail, so that we can safely use it?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              martin Martin Buchholz
              Reporter:
              martin Martin Buchholz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: