Re: Javadoc for ConcurrentSkipListMap.computeIfAbsent()

Martin Buchholz via Concurrency-interest <[email protected]>
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <CA+kOe0-HAFgFwSopbdfxUwRNfs++KOKaSTLCk9_RCysG-mZCcA@mail.gmail.com>
We tried to improve the docs for ConcurrentHashMap in
https://hg.openjdk.java.net/jdk/jdk/rev/35bac2745d04
ConcurrentSkipListMap has a different spec but could also benefit from
similar improvements.
The key idea is that the ConcurrentHashMap "locks" an entry while a
remapping function is called, but ConcurrentSkipListMap does not.
But that's still not very clear.  And we don't want to use any wording like
"entry is locked".

On Sun, Feb 23, 2020 at 8:57 PM Roman Leventov via Concurrency-interest <
[email protected]> wrote:

> It says: "The function is NOT guaranteed to be applied once atomically
> only if the value is not present."
>
> It's hard to parse this sentence, and it seems to me to make little
> sense since when the value is present, the function is not applied at all.
> IMO it would be better to remove the last part "only if the value is not
> present", making it equal to the corresponding sentence in compute() and
> computeIfPresent() Javadocs.
> _______________________________________________
> 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
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.