Github user franz1981 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/2478
  
    @gaohoward The synchronized block will block any threads attempting to both 
getting and creating a paging store, while a chm::get is lock-free ie won't 
block any threads and chm::computeIfAbsent is locked on per-segment basis (that 
means that depends on the number of segments and how the hashing of the keys 
will distribute the entries into the segment.
    
    Putting a synchronized like this will prevent any threads to do anything on 
an hot-path, blocking each others: my advice is to keep chm::get lock-free (as 
it is now) and into `newStore(storeName)` use chm::computeIfAbsent to avoid 
duplicates creatings of `PagingStore` instances.
    This should keep the scalability as it is now without allocating 
unnecessary instances. wdyt?


---

Reply via email to