Skip to content

Commit 39c7ed1

Browse files
committed
Use Doxygen style comments + formatting
1 parent eb6ae8c commit 39c7ed1

File tree

4 files changed

+50
-46
lines changed

4 files changed

+50
-46
lines changed

Disruptor.PerfTests/OneToOneRawBatchThroughputTest.h

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,42 @@ namespace Disruptor
1818
namespace PerfTests
1919
{
2020

21-
/// <summary>
22-
/// UniCast a series of items between 1 publisher and 1 event processor.
23-
/// +----+ +-----+
24-
/// | P1 |--->| EP1 |
25-
/// +----+ +-----+
26-
///
27-
/// Queue Based:
28-
/// ============
29-
///
30-
/// put take
31-
/// +----+ +====+ +-----+
32-
/// | P1 |---\| Q1 |/---| EP1 |
33-
/// +----+ +====+ +-----+
34-
///
35-
/// P1 - Publisher 1
36-
/// Q1 - Queue 1
37-
/// EP1 - EventProcessor 1
38-
///
39-
/// Disruptor:
40-
/// ==========
41-
/// track to prevent wrap
42-
/// +------------------+
43-
/// | |
44-
/// | v
45-
/// +----+ +====+ +====+ +-----+
46-
/// | P1 |--->| RB |/---| SB | | EP1 |
47-
/// +----+ +====+ +====+ +-----+
48-
/// claim get ^ |
49-
/// | |
50-
/// +--------+
51-
/// waitFor
52-
/// P1 - Publisher 1
53-
/// RB - RingBuffer
54-
/// SB - SequenceBarrier
55-
/// EP1 - EventProcessor 1
56-
/// </summary>
21+
/**
22+
* UniCast a series of items between 1 publisher and 1 event processor.
23+
* +----+ +-----+
24+
* | P1 |--->| EP1 |
25+
* +----+ +-----+
26+
*
27+
* Queue Based:
28+
* ============
29+
*
30+
* put take
31+
* +----+ +====+ +-----+
32+
* | P1 |---\| Q1 |/---| EP1 |
33+
* +----+ +====+ +-----+
34+
*
35+
* P1 - Publisher 1
36+
* Q1 - Queue 1
37+
* EP1 - EventProcessor 1
38+
*
39+
* Disruptor:
40+
* ==========
41+
* track to prevent wrap
42+
* +------------------+
43+
* | |
44+
* | v
45+
* +----+ +====+ +====+ +-----+
46+
* | P1 |--->| RB |/---| SB | | EP1 |
47+
* +----+ +====+ +====+ +-----+
48+
* claim get ^ |
49+
* | |
50+
* +--------+
51+
* waitFor
52+
* P1 - Publisher 1
53+
* RB - RingBuffer
54+
* SB - SequenceBarrier
55+
* EP1 - EventProcessor 1
56+
*/
5757
class OneToOneRawBatchThroughputTest : public IThroughputTest
5858
{
5959
class MyRunnable;

Disruptor.PerfTests/OneToOneRawThroughputTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace PerfTests
5656
return 2;
5757
}
5858

59-
void OneToOneRawThroughputTest::waitForEventProcessorSequence(std::int64_t expectedCount)
59+
void OneToOneRawThroughputTest::waitForEventProcessorSequence(std::int64_t expectedCount) const
6060
{
6161
while (m_myRunnable->sequence->value() != expectedCount)
6262
{
@@ -75,7 +75,7 @@ namespace PerfTests
7575
m_expectedCount = expectedCount;
7676
}
7777

78-
void OneToOneRawThroughputTest::MyRunnable::run()
78+
void OneToOneRawThroughputTest::MyRunnable::run() const
7979
{
8080
auto expected = m_expectedCount;
8181

@@ -85,11 +85,13 @@ namespace PerfTests
8585
try
8686
{
8787
std::int64_t processed;
88+
8889
do
8990
{
9091
processed = b.waitFor(s.value() + 1);
9192
s.setValue(processed);
92-
} while (processed < expected);
93+
}
94+
while (processed < expected);
9395

9496
m_latch->set();
9597
s.setValueVolatile(processed);

Disruptor.PerfTests/OneToOneRawThroughputTest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace PerfTests
6767
std::int32_t requiredProcessorCount() const override;
6868

6969
private:
70-
void waitForEventProcessorSequence(std::int64_t expectedCount);
70+
void waitForEventProcessorSequence(std::int64_t expectedCount) const;
7171

7272
const std::int32_t m_bufferSize = 1024 * 64;
7373

@@ -90,7 +90,7 @@ namespace PerfTests
9090

9191
void reset(const std::shared_ptr< Tests::ManualResetEvent >& latch, std::int64_t expectedCount);
9292

93-
void run();
93+
void run() const;
9494

9595
std::shared_ptr< Sequence > sequence = std::make_shared< Sequence >(-1);
9696

Disruptor/ISequence.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ namespace Disruptor
1818
virtual std::int64_t value() const = 0;
1919

2020
/**
21-
* Perform an ordered write of this sequence. The intent is
22-
a Store/Store barrier between this write and any previous
23-
store.
21+
* Perform an ordered write of this sequence. The intent isa Store/Store barrier between this write and any previous store.
22+
*
2423
* \param value The new value for the sequence.
2524
*/
2625
virtual void setValue(std::int64_t value) = 0;
2726

2827
/**
29-
* Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous
30-
write and a Store/Load barrier between this write and any subsequent volatile read.
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+
*
3130
* \param value
3231
*/
3332
virtual void setValueVolatile(std::int64_t value) = 0;
3433

3534
/**
3635
* Atomically set the value to the given updated value if the current value == the expected value.
36+
*
3737
* \param expectedSequence the expected value for the sequence
3838
* \param nextSequence the new value for the sequence
3939
* \returns true if successful. False return indicates that the actual value was not equal to the expected value.
@@ -42,12 +42,14 @@ namespace Disruptor
4242

4343
/**
4444
* Increments the sequence and stores the result, as an atomic operation.
45+
*
4546
* \returns incremented sequence
4647
*/
4748
virtual std::int64_t incrementAndGet() = 0;
4849

4950
/**
5051
* Increments the sequence and stores the result, as an atomic operation.
52+
*
5153
* \returns incremented sequence
5254
*/
5355
virtual std::int64_t addAndGet(std::int64_t value) = 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy