#define GetConfig(field) s_n##field = cfg.get_size_t(#field, s_n##field)
+#define GetConfigExpected(field, expected) \
+ s_n##field = cfg.get_size_t(#field, s_n##field); \
+ if (s_n##field < (expected)) { \
+ s_n##field = expected; \
+ }
#ifdef PERFORMANCE
#define DEBUG(stmt)
static size_t s_nRigtorpMPMCQueueCapacity;
static void SetUpTestCase() {
- cds_test::config const &cfg = get_config("Misc");
- GetConfig(RigtorpMPMCQueuePassCount);
- GetConfig(RigtorpMPMCQueueEnqueueStride);
- GetConfig(RigtorpMPMCQueueCapacity);
+ cds_test::config const &cfg = get_config("SequentialMisc");
+ GetConfigExpected(RigtorpMPMCQueuePassCount, 10000);
+ GetConfigExpected(RigtorpMPMCQueueEnqueueStride, 1024);
+ GetConfigExpected(RigtorpMPMCQueueCapacity, 2048);
+ if (s_nRigtorpMPMCQueueCapacity <= s_nRigtorpMPMCQueueEnqueueStride) {
+ s_nRigtorpMPMCQueueCapacity = 2 * s_nRigtorpMPMCQueueEnqueueStride;
+ }
}
void test() {
size_t pop_sum = 0;
while (nNo < s_nRigtorpMPMCQueuePassCount) {
- size_t curr_push_count =
- std::min(s_nRigtorpMPMCQueuePassCount - nNo, s_nRigtorpMPMCQueueEnqueueStride);
+ size_t curr_push_count = std::min(s_nRigtorpMPMCQueuePassCount - nNo,
+ s_nRigtorpMPMCQueueEnqueueStride);
for (size_t i = 0; i < curr_push_count; i++) {
q.push(nNo);
++nNo;