Github user franz1981 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1851
  
    @wy96f 
    > In your example
    
    My example was just to show the method used to perform a padding with an 
existing abstract class, has not values from the perf purposes: sorry, my 
mistake to not have specified it at first :P
    
    > i know that stampedLock fileds are in different cache lines for different 
sections
    
    For any of these reasonings consider 2 facts:
    1. false sharing must not  be considered between cache lines but on 
prefetching size basis (ie 128 bytes == 2 cache lines)
    2. the GC could arbitrarly choose to scatter Section instances on the heap 
in an order different from Section[] ie it is a GC implementation detail, 
although it is mostly true in this case
    
    Hence, it would be great to protect each Section fields from any 
surrounding part of the heap that could invalidate its fields cache lines for 
any reasons: it could be another Section (what is likely to happen)  or any 
"living" instance the GC has chosen to move near to them.
    
    In our case that could happen but probably it is more necessary to be 
"fixed" in the original class of Bookkeeper, that's more general purpose.
    
    
    
    
    
    
    
    
    
    
    



---

Reply via email to