[concurrency-interest] Javadoc for ConcurrentSkipListMap.computeIfAbsent()

Martin Buchholz martinrb at google.com
Mon Feb 24 11:25:51 EST 2020

We tried to improve the docs for ConcurrentHashMap in
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 <
concurrency-interest at cs.oswego.edu> 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
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20200224/00c083c3/attachment.htm>

More information about the Concurrency-interest mailing list