Re: Concurrent Hash Map javadoc question

Martin Buchholz via Concurrency-interest <[email protected]>
Newsgroups gmane.comp.java.jsr.166-concurrency,gmane.comp.java.openjdk.general
Message-ID <CA+kOe0_0ztr4rtffTBzCB9+SWstR=FsV4PZR6h0shN4+2KOG8A@mail.gmail.com>
I was wrong and filed

   1. DK <https://bugs.openjdk.java.net/browse/JDK>
   2. JDK-8231592 <https://bugs.openjdk.java.net/browse/JDK-8231592>

Clarify that ConcurrentHashMap compute methods mapping functions execute at
most once


On Wed, Sep 18, 2019 at 7:23 AM Keith Turner <[email protected]> wrote:

> On Tue, Sep 17, 2019 at 9:35 PM Martin Buchholz <[email protected]>
> wrote:
> >
> > I think this doc difference is intentional.
>
> If that is the case, it would be really nice update the javadoc to
> make it explicit.
>
> >
> > In case of a retry loop, the value may have changed in the case of
> computeIfPresent or compute and so the function must be called again with
> the new value.
> >
> > On Tue, Sep 17, 2019 at 4:36 PM Martijn Verburg <
> [email protected]> wrote:
> >>
> >> Hi Keith,
> >>
> >> I think this is one for concurrency interest to answer.
> >>
> >> Cheers,
> >> Martijn
> >>
> >>
> >> On Tue, 17 Sep 2019 at 12:48, Keith Turner <[email protected]> wrote:
> >>
> >> > The javadoc for ConcurrentHashMap.computeIfAbsent() states the
> >> > remapping function is applied at most once.  The functions
> >> > computeIfPresent() and compute() do not explicitly state if the
> >> > remapping functions could possibly be run multiple times. Does anyone
> >> > know if computeIfPresent() and compute() are guaranteed to only run
> >> > the remapping functions at most once?  If so, should the javadoc be
> >> > updated?
> >> >
> >> > Thanks,
> >> >
> >> > Keith
> >> >
>

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.