Changeset 509 for Tests


Ignore:
Timestamp:
03/27/12 21:28:53 (10 years ago)
Author:
BegemoT
Message:
 
File:
1 copied

Legend:

Unmodified
Added
Removed
  • Tests/JAVA/test/src/main/java/test/threads/queue/unstressed/impl/CABSESDLazySetPaddedQueueUnrolled.java

    r508 r509  
    1414 * @since 27.09.11,  14:58 
    1515 */ 
    16 public class CABSESDLazySetQueueUnrolled<T> implements IQueue<T> { 
     16public class CABSESDLazySetPaddedQueueUnrolled<T> implements IQueue<T> { 
    1717    private static final boolean USE_BITMASK = true; 
    1818    //====================================================== 
    19     private static final AtomicLongFieldUpdater<CABSESDLazySetQueueUnrolled> tailUpdater = AtomicLongFieldUpdater.newUpdater( CABSESDLazySetQueueUnrolled.class, "tailCursor" ); 
    20     private static final AtomicLongFieldUpdater<CABSESDLazySetQueueUnrolled> headUpdater = AtomicLongFieldUpdater.newUpdater( CABSESDLazySetQueueUnrolled.class, "headCursor" ); 
     19    private static final AtomicLongFieldUpdater<CABSESDLazySetPaddedQueueUnrolled> tailUpdater = AtomicLongFieldUpdater.newUpdater( CABSESDLazySetPaddedQueueUnrolled.class, "tailCursor" ); 
     20    private static final AtomicLongFieldUpdater<CABSESDLazySetPaddedQueueUnrolled> headUpdater = AtomicLongFieldUpdater.newUpdater( CABSESDLazySetPaddedQueueUnrolled.class, "headCursor" ); 
    2121    //====================================================== 
    2222 
     
    3636    private final int length; 
    3737    private volatile long headCursor = 0; 
    38     //    private volatile long p11, p12, p13, p14, p15, p16, p17, p18 = 7; 
     38    public volatile long p11, p12, p13, p14, p15, p16, p17, p18 = 7; 
    3939    private volatile long tailCursor = 0; 
    40 //    private volatile long p21, p22, p23, p24, p25, p26, p27, p28 = 8; 
     40    public volatile long p21, p22, p23, p24, p25, p26, p27, p28 = 8; 
    4141 
    4242    public long sumPaddingToPreventOptimisation() { 
    43 //        return p11 + p12 + p13 + p14 + p15 + p16 + p17 + p18 
    44 //                + p21 + p22 + p23 + p24 + p25 + p26 + p27 + p28; 
    45         return 0; 
     43        return p11 + p12 + p13 + p14 + p15 + p16 + p17 + p18 
     44                + p21 + p22 + p23 + p24 + p25 + p26 + p27 + p28; 
    4645    } 
    4746 
     
    4948 
    5049 
    51     public CABSESDLazySetQueueUnrolled( final int length ) { 
     50    public CABSESDLazySetPaddedQueueUnrolled( final int length ) { 
    5251        checkArgument( length > 0, "length(%s) must be >0", length ); 
    5352        if ( USE_BITMASK ) { 
     
    134133 
    135134    @SuppressWarnings( "unchecked" ) 
    136     public static <T> IBoundedQueueFactory<T, CABSESDLazySetQueueUnrolled<T>> factory() { 
     135    public static <T> IBoundedQueueFactory<T, CABSESDLazySetPaddedQueueUnrolled<T>> factory() { 
    137136        return FACTORY; 
    138137    } 
    139138 
    140     public static final IBoundedQueueFactory FACTORY = new IBoundedQueueFactory<Object, CABSESDLazySetQueueUnrolled<Object>>() { 
     139    public static final IBoundedQueueFactory FACTORY = new IBoundedQueueFactory<Object, CABSESDLazySetPaddedQueueUnrolled<Object>>() { 
    141140        @Override 
    142         public CABSESDLazySetQueueUnrolled<Object> create( final int size ) { 
    143             return new CABSESDLazySetQueueUnrolled<Object>( size ); 
     141        public CABSESDLazySetPaddedQueueUnrolled<Object> create( final int size ) { 
     142            return new CABSESDLazySetPaddedQueueUnrolled<Object>( size ); 
    144143        } 
    145144 
Note: See TracChangeset for help on using the changeset viewer.