-
Enhancement
-
Resolution: Done
-
Major
-
3.0.11, 4.0.1
-
None
The LinkMap API methods (createLinkMap, deleteLinkMap, link, linked, unlink, linkNames, linkValues, clearLinks) all perform their relevant operations synchronized on the top level HashMap that associates map names with their underlying link map. That makes the exclusion window for these operations unnecessarily wide. Worse, it causes an unnecessary exclusion bottleneck between threads operating on independent link maps.
The outer HashMap would be better replaced with a ConncurrentHashMap, allowing linkmap create, lookup and delete operations to operate with no risk of inappropriate exclusion. The LinkMap API methods will need ot be modified to synchronize on the HashMap used to model the link map being operated on. This will ensure that API methods only exclude competing threads when they operate on the same map and do so with as minimal an exclusion window as possible.