Changeset 541 for Tests


Ignore:
Timestamp:
04/10/12 14:39:18 (10 years ago)
Author:
BegemoT
Message:
 
Location:
Tests/JAVA/test/src/main/java
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • Tests/JAVA/test/src/main/java/com/lmax/disruptor/Sequence.java

    r300 r541  
    11package com.lmax.disruptor; 
     2 
     3import java.util.concurrent.atomic.AtomicLong; 
    24 
    35import com.lmax.disruptor.util.PaddedAtomicLong; 
     
    1012public class Sequence { 
    1113    private final PaddedAtomicLong value = new PaddedAtomicLong( Sequencer.INITIAL_CURSOR_VALUE ); 
     14//    private final AtomicLong value = new AtomicLong( Sequencer.INITIAL_CURSOR_VALUE ); 
    1215 
    1316    /** Default Constructor that uses an initial value of {@link com.lmax.disruptor.Sequencer#INITIAL_CURSOR_VALUE}.*/ 
     
    2831    } 
    2932 
    30     public void set( final long value ) { 
    31 //        this.value.set( value ); 
    32         this.value.lazySet( value ); 
     33    public void set( final long _value ) { 
     34//        this.value.set( _value ); 
     35        this.value.lazySet( _value ); 
    3336    } 
    34  
    35     /*private volatile long value; 
    36     public volatile long p1, p2, p3, p4, p5, p6 = 7L; 
    37  
    38     public Sequence() { 
    39         this( Sequencer.INITIAL_CURSOR_VALUE ); 
    40     } 
    41  
    42     public Sequence( final long initialValue ) { 
    43         this.value = initialValue; 
    44     } 
    45  
    46     public long get() { 
    47         return value; 
    48     } 
    49  
    50     public void set( final long value ) { 
    51         this.value = value; 
    52     } 
    53  
    54     public long sumPaddingToPreventOptimisation() { 
    55         return p1 + p2 + p3 + p4 + p5 + p6; 
    56     }*/ 
    5737} 
  • Tests/JAVA/test/src/main/java/test/threads/queue/unstressed/DisruptorTask.java

    r540 r541  
    127127        } 
    128128 
    129         sumAfterGaps += ringBuffer.getCursor() - lastSequence.get(); 
     129        final long gap = ringBuffer.getCursor() - lastSequence.get(); 
     130        sumAfterGaps += gap; 
    130131        gapsMeasured++; 
     132 
     133        /*if ( gap < 4 ) { 
     134            Thread.yield(); 
     135        }*/ 
    131136        return sum; 
    132137    } 
Note: See TracChangeset for help on using the changeset viewer.