You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing to report a misuse of ConcurrentHashMap, which may lead to efficiency problem. I would very appreciate if you could check below for details and confirm with us whether it is a real problem.
File: "alibaba/mdrill/trunk/adhoc-solr/src/main/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java"
Location: Line 100
Description:
The synchronized block form line 100 to line 102 only contains one update operation to the ConcurrentHashMap object. According to the Java API specifications, ConcurrentHashMap can guarantee "high expected concurrency for updates". In this case, there is no multiple operations (such as check-then-act operation) which need atomicity guarantees. Therefore the concurrency can be guaranteed by ConcurrentHaspMap. The locking in line 100 may not be necessary since it causes efficiency problems, which is against the motivation to use the Concurrent Collections. Relying on the ConcurrentHashMap to ensure exclusive access is dangerous since ConcurrentHashMap has no guarantee of exclusive access.
The text was updated successfully, but these errors were encountered:
Hi, Developers of alibaba/mdrill,
I am writing to report a misuse of ConcurrentHashMap, which may lead to efficiency problem. I would very appreciate if you could check below for details and confirm with us whether it is a real problem.
File: "alibaba/mdrill/trunk/adhoc-solr/src/main/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java"
Location: Line 100
Description:
The synchronized block form line 100 to line 102 only contains one update operation to the ConcurrentHashMap object. According to the Java API specifications, ConcurrentHashMap can guarantee "high expected concurrency for updates". In this case, there is no multiple operations (such as check-then-act operation) which need atomicity guarantees. Therefore the concurrency can be guaranteed by ConcurrentHaspMap. The locking in line 100 may not be necessary since it causes efficiency problems, which is against the motivation to use the Concurrent Collections. Relying on the ConcurrentHashMap to ensure exclusive access is dangerous since ConcurrentHashMap has no guarantee of exclusive access.
The text was updated successfully, but these errors were encountered: