Re: Phaser.arrive() memory consistency effects

Martin Buchholz via Concurrency-interest <[email protected]> Fri, 29 Jan 2021 09:28:39 -0800
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <CA+kOe0_2bOgQRrfXQ_U3=rEw-anRsSOgKuYmR2d7Ef_PNq59mQ@mail.gmail.com>
Filed as https://bugs.openjdk.java.net/browse/JDK-8260664

On Fri, Jan 29, 2021 at 3:08 AM Petr Janeček via Concurrency-interest <
[email protected]> wrote:

> 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?
>
> Thank you,
> Petr Janeček
> _______________________________________________
> Concurrency-interest mailing list
> [email protected]
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest