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

Alex Otenko oleksandr.otenko at gmail.com
Mon Feb 24 04:43:17 EST 2020


Define "present" / "not present".

In a concurrent setting the boolean outcome of the function does not imply
anything about how it decided that. In particular, was it seen "not
present", but lost the race to set the new value.

Alex

On Mon, 24 Feb 2020, 04:57 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/a002eb81/attachment.htm>


More information about the Concurrency-interest mailing list