- Timestamp:
- 04/10/12 14:39:18 (10 years ago)
- 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 1 1 package com.lmax.disruptor; 2 3 import java.util.concurrent.atomic.AtomicLong; 2 4 3 5 import com.lmax.disruptor.util.PaddedAtomicLong; … … 10 12 public class Sequence { 11 13 private final PaddedAtomicLong value = new PaddedAtomicLong( Sequencer.INITIAL_CURSOR_VALUE ); 14 // private final AtomicLong value = new AtomicLong( Sequencer.INITIAL_CURSOR_VALUE ); 12 15 13 16 /** Default Constructor that uses an initial value of {@link com.lmax.disruptor.Sequencer#INITIAL_CURSOR_VALUE}.*/ … … 28 31 } 29 32 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 ); 33 36 } 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 }*/57 37 } -
Tests/JAVA/test/src/main/java/test/threads/queue/unstressed/DisruptorTask.java
r540 r541 127 127 } 128 128 129 sumAfterGaps += ringBuffer.getCursor() - lastSequence.get(); 129 final long gap = ringBuffer.getCursor() - lastSequence.get(); 130 sumAfterGaps += gap; 130 131 gapsMeasured++; 132 133 /*if ( gap < 4 ) { 134 Thread.yield(); 135 }*/ 131 136 return sum; 132 137 }
Note: See TracChangeset
for help on using the changeset viewer.