Skip to content

Commit 3faf3ff

Browse files
committed
Removed setValueVolatile from ISequence
1 parent 264fc59 commit 3faf3ff

File tree

10 files changed

+7
-41
lines changed

10 files changed

+7
-41
lines changed

Disruptor.PerfTests/OneToOneRawBatchThroughputTest.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ namespace PerfTests
7272
{
7373
processed = m_barrier->waitFor(sequence->value() + 1);
7474
sequence->setValue(processed);
75-
} while (processed < expected);
75+
}
76+
while (processed < expected);
7677

7778
m_latch->set();
78-
sequence->setValueVolatile(processed);
79+
sequence->setValue(processed);
7980
}
8081
catch (std::exception& ex)
8182
{

Disruptor.PerfTests/OneToOneRawThroughputTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ namespace PerfTests
9494
while (processed < expected);
9595

9696
m_latch->set();
97-
s.setValueVolatile(processed);
97+
s.setValue(processed);
9898
}
9999
catch (std::exception& ex)
100100
{

Disruptor.Tests/SequenceBarrierTestsFixture.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ namespace Tests
7474
m_sequenceImplementation->setValue(value);
7575
}
7676

77-
void SequenceBarrierTestsFixture::CountDownEventSequence::setValueVolatile(std::int64_t value)
78-
{
79-
m_sequenceImplementation->setValueVolatile(value);
80-
}
81-
8277
bool SequenceBarrierTestsFixture::CountDownEventSequence::compareAndSet(std::int64_t expectedSequence, std::int64_t nextSequence)
8378
{
8479
return m_sequenceImplementation->compareAndSet(expectedSequence, nextSequence);

Disruptor.Tests/SequenceBarrierTestsFixture.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ namespace Tests
6161

6262
void setValue(std::int64_t value) override;
6363

64-
void setValueVolatile(std::int64_t value) override;
65-
6664
bool compareAndSet(std::int64_t expectedSequence, std::int64_t nextSequence) override;
6765

6866
std::int64_t incrementAndGet() override;

Disruptor/FixedSequenceGroup.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ namespace Disruptor
2525
DISRUPTOR_THROW_NOT_SUPPORTED_EXCEPTION();
2626
}
2727

28-
void FixedSequenceGroup::setValueVolatile(std::int64_t /*value*/)
29-
{
30-
DISRUPTOR_THROW_NOT_SUPPORTED_EXCEPTION();
31-
}
32-
3328
bool FixedSequenceGroup::compareAndSet(std::int64_t /*expectedValue*/, std::int64_t /*newValue*/)
3429
{
3530
DISRUPTOR_THROW_NOT_SUPPORTED_EXCEPTION();

Disruptor/ISequence.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ namespace Disruptor
2424
*/
2525
virtual void setValue(std::int64_t value) = 0;
2626

27-
/**
28-
* Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous write and a Store/Load barrier between this write and any subsequent volatile read.
29-
*
30-
* \param value
31-
*/
32-
virtual void setValueVolatile(std::int64_t value) = 0;
33-
3427
/**
3528
* Atomically set the value to the given updated value if the current value == the expected value.
3629
*

Disruptor/NoOpEventProcessor.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ namespace Disruptor
9797
{
9898
}
9999

100-
void setValueVolatile(std::int64_t /*value*/) override
101-
{
102-
}
103-
104100
bool compareAndSet(std::int64_t /*expectedSequence*/, std::int64_t /*nextSequence*/) override
105101
{
106102
return false;

Disruptor/Sequence.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ namespace Disruptor
2424
std::atomic_store_explicit(&m_fieldsValue, value, std::memory_order_release);
2525
}
2626

27-
void Sequence::setValueVolatile(std::int64_t value)
28-
{
29-
m_fieldsValue = value;
30-
}
31-
3227
bool Sequence::compareAndSet(std::int64_t expectedSequence, std::int64_t nextSequence)
3328
{
3429
return std::atomic_compare_exchange_strong(&m_fieldsValue, &expectedSequence, nextSequence);

Disruptor/Sequence.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ namespace Disruptor
3434
*/
3535
void setValue(std::int64_t value) override;
3636

37-
/**
38-
* Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous write and a Store/Load barrier between this write and any subsequent volatile read.
39-
*
40-
* \param value
41-
*/
42-
void setValueVolatile(std::int64_t value) override;
43-
4437
/**
4538
* Atomically set the value to the given updated value if the current value == the expected value.
4639
*
@@ -72,9 +65,9 @@ namespace Disruptor
7265
static const std::int64_t InitialCursorValue;
7366

7467
private:
75-
char padding0[56];
68+
char m_padding0[56] = {};
7669
std::atomic< std::int64_t > m_fieldsValue;
77-
char padding1[56];
70+
char m_padding1[56] = {};
7871
};
7972

8073
} // namespace Disruptor

Disruptor/SingleProducerSequencer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace Disruptor
9999

100100
if (wrapPoint > cachedGatingSequence || cachedGatingSequence > nextValue)
101101
{
102-
this->m_cursor->setValueVolatile(nextValue);
102+
this->m_cursor->setValue(nextValue);
103103

104104
SpinWait spinWait;
105105
std::int64_t minSequence;

0 commit comments

Comments
 (0)