Click here to Skip to main content
15,890,527 members
Articles / Programming Languages / Java

A Few Words About ConcurrentHashMap, compute() Method

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
28 Jul 2020CPOL2 min read 3.3K  
There is one ambiguous moment in the Java documentation of the compute() method from the ConcurrentHashMap class.
According to the documentation, "some attempted update operations on this map by other threads may be blocked while computation is in progress, so the computation should be short and simple, and must not attempt to update any other mappings of this Map." It's not clear what is being blocked. Is it the access to the entire map or to the key? This article discusses that.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) BlackRock
United Kingdom United Kingdom
My name is Ruslan Ciurca. Currently, I am a Software Engineer at BlackRock.

Comments and Discussions