Skip to content

Commit 30ecf49

Browse files
author
Maxim Egorushkin
committed
Better CapacityArgAdaptor name.
1 parent 689c48e commit 30ecf49

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) BUILD=debug run_tests
77
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) all run_tests
88
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) run_benchmarks
9-
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TAGS
9+
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang-20 BUILD=debug TAGS
1010
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang-20 BUILD=debug run_tests
1111
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang BUILD=sanitize run_tests
1212
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang run_benchmarks

include/atomic_queue/atomic_queue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,8 @@ struct RetryDecorator : Queue {
650650
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
651651

652652
template<class Queue, size_t Capacity>
653-
struct CapacityArgDecorator : Queue {
654-
CapacityArgDecorator()
653+
struct CapacityArgAdaptor : Queue {
654+
CapacityArgAdaptor()
655655
: Queue(Capacity)
656656
{}
657657
};

src/benchmarks.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ struct QueueTypes {
152152
// For atomic elements only.
153153
using AtomicQueue = Type<RetryDecorator<atomic_queue::AtomicQueue<T, SIZE, T{}, MINIMIZE_CONTENTION, MAXIMIZE_THROUGHPUT, false, SPSC>>>;
154154
using OptimistAtomicQueue = Type<atomic_queue::AtomicQueue<T, SIZE, T{}, MINIMIZE_CONTENTION, MAXIMIZE_THROUGHPUT, false, SPSC>>;
155-
using AtomicQueueB = Type<RetryDecorator<CapacityArgDecorator<atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>>;
156-
using OptimistAtomicQueueB = Type<CapacityArgDecorator<atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>;
155+
using AtomicQueueB = Type<RetryDecorator<CapacityArgAdaptor<atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>>;
156+
using OptimistAtomicQueueB = Type<CapacityArgAdaptor<atomic_queue::AtomicQueueB<T, Allocator, T{}, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>;
157157

158158
// For non-atomic elements.
159159
using AtomicQueue2 = Type<RetryDecorator<atomic_queue::AtomicQueue2<T, SIZE, MINIMIZE_CONTENTION, MAXIMIZE_THROUGHPUT, false, SPSC>>>;
160160
using OptimistAtomicQueue2 = Type<atomic_queue::AtomicQueue2<T, SIZE, MINIMIZE_CONTENTION, MAXIMIZE_THROUGHPUT, false, SPSC>>;
161-
using AtomicQueueB2 = Type<RetryDecorator<CapacityArgDecorator<atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>>;
162-
using OptimistAtomicQueueB2 = Type<CapacityArgDecorator<atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>;
161+
using AtomicQueueB2 = Type<RetryDecorator<CapacityArgAdaptor<atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>>;
162+
using OptimistAtomicQueueB2 = Type<CapacityArgAdaptor<atomic_queue::AtomicQueueB2<T, Allocator, MAXIMIZE_THROUGHPUT, false, SPSC>, SIZE>>;
163163
};
164164

165165
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -346,7 +346,7 @@ void run_throughput_benchmarks(HugePages& hp, std::vector<CpuTopologyInfo> const
346346
run_throughput_mpmc_benchmark("xenium::ramalhete_queue", hp, hw_thread_ids,
347347
Type<XeniumQueueAdapter<xenium::ramalhete_queue<unsigned, xenium::policy::reclaimer<Reclaimer>>>>{});
348348
run_throughput_mpmc_benchmark("xenium::vyukov_bounded_queue", hp, hw_thread_ids,
349-
Type<RetryDecorator<CapacityArgDecorator<xenium::vyukov_bounded_queue<unsigned>, SIZE>>>{});
349+
Type<RetryDecorator<CapacityArgAdaptor<xenium::vyukov_bounded_queue<unsigned>, SIZE>>>{});
350350

351351
using SPSC = QueueTypes<SIZE, true, false, false>;
352352
using MPMC = QueueTypes<SIZE, false, true, true>; // Enable MAXIMIZE_THROUGHPUT for 2 or more producers/consumers.
@@ -493,7 +493,7 @@ void run_ping_pong_benchmarks(HugePages& hp, std::vector<CpuTopologyInfo> const&
493493

494494
run_ping_pong_benchmark<XeniumQueueAdapter<xenium::michael_scott_queue<unsigned, xenium::policy::reclaimer<Reclaimer>>>>("xenium::michael_scott_queue", hp, hw_thread_ids);
495495
run_ping_pong_benchmark<XeniumQueueAdapter<xenium::ramalhete_queue<unsigned, xenium::policy::reclaimer<Reclaimer>>>>("xenium::ramalhete_queue", hp, hw_thread_ids);
496-
run_ping_pong_benchmark<RetryDecorator<CapacityArgDecorator<xenium::vyukov_bounded_queue<unsigned>, SIZE>>>("xenium::vyukov_bounded_queue", hp, hw_thread_ids);
496+
run_ping_pong_benchmark<RetryDecorator<CapacityArgAdaptor<xenium::vyukov_bounded_queue<unsigned>, SIZE>>>("xenium::vyukov_bounded_queue", hp, hw_thread_ids);
497497

498498
// Use MAXIMIZE_THROUGHPUT=false for better latency.
499499
using SPSC = QueueTypes<SIZE, true, false, false>;

src/tests.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,35 +189,35 @@ BOOST_AUTO_TEST_CASE(spsc_stress_OptimistAtomicQueue2) {
189189
}
190190

191191
BOOST_AUTO_TEST_CASE(stress_AtomicQueueB) {
192-
stress<RetryDecorator<CapacityArgDecorator<AtomicQueueB<unsigned>, CAPACITY>>>();
192+
stress<RetryDecorator<CapacityArgAdaptor<AtomicQueueB<unsigned>, CAPACITY>>>();
193193
}
194194

195195
BOOST_AUTO_TEST_CASE(stress_OptimistAtomicQueueB) {
196-
stress<CapacityArgDecorator<AtomicQueueB<unsigned>, CAPACITY>>();
196+
stress<CapacityArgAdaptor<AtomicQueueB<unsigned>, CAPACITY>>();
197197
}
198198

199199
BOOST_AUTO_TEST_CASE(stress_AtomicQueueB2) {
200-
stress<RetryDecorator<CapacityArgDecorator<AtomicQueueB2<unsigned>, CAPACITY>>>();
200+
stress<RetryDecorator<CapacityArgAdaptor<AtomicQueueB2<unsigned>, CAPACITY>>>();
201201
}
202202

203203
BOOST_AUTO_TEST_CASE(stress_OptimistAtomicQueueB2) {
204-
stress<CapacityArgDecorator<AtomicQueueB2<unsigned>, CAPACITY>>();
204+
stress<CapacityArgAdaptor<AtomicQueueB2<unsigned>, CAPACITY>>();
205205
}
206206

207207
BOOST_AUTO_TEST_CASE(spsc_stress_AtomicQueueB) {
208-
stress<RetryDecorator<CapacityArgDecorator<AtomicQueueB<unsigned, std::allocator<unsigned>, 0u, true, false, true>, CAPACITY>>, 1, 1>();
208+
stress<RetryDecorator<CapacityArgAdaptor<AtomicQueueB<unsigned, std::allocator<unsigned>, 0u, true, false, true>, CAPACITY>>, 1, 1>();
209209
}
210210

211211
BOOST_AUTO_TEST_CASE(spsc_stress_OptimistAtomicQueueB) {
212-
stress<CapacityArgDecorator<AtomicQueueB<unsigned, std::allocator<unsigned>, 0u, true, false, true>, CAPACITY>, 1, 1>();
212+
stress<CapacityArgAdaptor<AtomicQueueB<unsigned, std::allocator<unsigned>, 0u, true, false, true>, CAPACITY>, 1, 1>();
213213
}
214214

215215
BOOST_AUTO_TEST_CASE(spsc_stress_AtomicQueueB2) {
216-
stress<RetryDecorator<CapacityArgDecorator<AtomicQueueB2<unsigned, std::allocator<unsigned>, true, false, true>, CAPACITY>>, 1, 1>();
216+
stress<RetryDecorator<CapacityArgAdaptor<AtomicQueueB2<unsigned, std::allocator<unsigned>, true, false, true>, CAPACITY>>, 1, 1>();
217217
}
218218

219219
BOOST_AUTO_TEST_CASE(spsc_stress_OptimistAtomicQueueB2) {
220-
stress<CapacityArgDecorator<AtomicQueueB2<unsigned, std::allocator<unsigned>, true, false, true>, CAPACITY>, 1, 1>();
220+
stress<CapacityArgAdaptor<AtomicQueueB2<unsigned, std::allocator<unsigned>, true, false, true>, CAPACITY>, 1, 1>();
221221
}
222222

223223
BOOST_AUTO_TEST_CASE(move_only_2) {

0 commit comments

Comments
 (0)