aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/queue
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/threading/queue
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/queue')
-rw-r--r--library/cpp/threading/queue/mpsc_htswap.h12
-rw-r--r--library/cpp/threading/queue/mpsc_intrusive_unordered.h2
-rw-r--r--library/cpp/threading/queue/mpsc_read_as_filled.h14
-rw-r--r--library/cpp/threading/queue/mpsc_vinfarr_obstructive.h8
-rw-r--r--library/cpp/threading/queue/queue_ut.cpp2
-rw-r--r--library/cpp/threading/queue/tune.h16
-rw-r--r--library/cpp/threading/queue/unordered_ut.cpp8
-rw-r--r--library/cpp/threading/queue/ut_helpers.h12
8 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/threading/queue/mpsc_htswap.h b/library/cpp/threading/queue/mpsc_htswap.h
index c42caa7ac0..420b1e8829 100644
--- a/library/cpp/threading/queue/mpsc_htswap.h
+++ b/library/cpp/threading/queue/mpsc_htswap.h
@@ -28,8 +28,8 @@ namespace NThreading {
namespace NHTSwapPrivate {
template <typename T, typename TTuneup>
struct TNode
- : public TTuneup::TNodeBase,
- public TTuneup::template TNodeLayout<TNode<T, TTuneup>, T> {
+ : public TTuneup::TNodeBase,
+ public TTuneup::template TNodeLayout<TNode<T, TTuneup>, T> {
TNode(const T& item) {
this->Next = nullptr;
this->Item = item;
@@ -60,7 +60,7 @@ namespace NThreading {
template <typename T, typename TTuneup>
class THTSwapQueueImpl
- : protected TTuneup::template TQueueLayout<TNode<T, TTuneup>> {
+ : protected TTuneup::template TQueueLayout<TNode<T, TTuneup>> {
protected:
using TTunedNode = TNode<T, TTuneup>;
@@ -124,9 +124,9 @@ namespace NThreading {
DeclareTuneTypeParam(THTSwapNodeLayout, TNodeLayout);
DeclareTuneTypeParam(THTSwapQueueLayout, TQueueLayout);
- template <typename T = void*, typename... TParams>
+ template <typename T = void*, typename... TParams>
class THTSwapQueue
- : public NHTSwapPrivate::THTSwapQueueImpl<T,
- TTune<NHTSwapPrivate::TDefaultTuneup, TParams...>> {
+ : public NHTSwapPrivate::THTSwapQueueImpl<T,
+ TTune<NHTSwapPrivate::TDefaultTuneup, TParams...>> {
};
}
diff --git a/library/cpp/threading/queue/mpsc_intrusive_unordered.h b/library/cpp/threading/queue/mpsc_intrusive_unordered.h
index 6ac7537ae9..97e6131dd4 100644
--- a/library/cpp/threading/queue/mpsc_intrusive_unordered.h
+++ b/library/cpp/threading/queue/mpsc_intrusive_unordered.h
@@ -25,7 +25,7 @@ namespace NThreading {
void Push(void* node) noexcept {
Push(reinterpret_cast<TIntrusiveNode*>(node));
}
-
+
private:
TIntrusiveNode* HeadForCaS = nullptr;
TIntrusiveNode* HeadForSwap = nullptr;
diff --git a/library/cpp/threading/queue/mpsc_read_as_filled.h b/library/cpp/threading/queue/mpsc_read_as_filled.h
index be33ba5a58..621517328e 100644
--- a/library/cpp/threading/queue/mpsc_read_as_filled.h
+++ b/library/cpp/threading/queue/mpsc_read_as_filled.h
@@ -132,7 +132,7 @@ namespace NThreading {
TMsgBunch* volatile NextToken;
/* this push can return PUSH_RESULT_BLOCKED */
- inline TPushResult Push(TMsgLink msg, ui64 slot, TAux auxiliary) {
+ inline TPushResult Push(TMsgLink msg, ui64 slot, TAux auxiliary) {
if (Y_UNLIKELY(slot < FirstSlot)) {
return PUSH_RESULT_BACKWARD;
}
@@ -194,7 +194,7 @@ namespace NThreading {
// the object could be destroyed after this method
inline void SetNextToken(TMsgBunch* next) {
AtomicSet(NextToken, next);
- if (Y_UNLIKELY(AtomicAdd(Token, RELEASE_SIZE) == RELEASE_SIZE)) {
+ if (Y_UNLIKELY(AtomicAdd(Token, RELEASE_SIZE) == RELEASE_SIZE)) {
Release(this);
next->DecrementToken();
}
@@ -317,8 +317,8 @@ namespace NThreading {
}
};
- template <typename TWBucket = TWriteBucket<>,
- template <typename, typename...> class TContainer = TDeque>
+ template <typename TWBucket = TWriteBucket<>,
+ template <typename, typename...> class TContainer = TDeque>
class TReadBucket {
public:
using TAux = typename TWBucket::TUsingAux;
@@ -543,7 +543,7 @@ namespace NThreading {
static constexpr ui32 BUNCH_SIZE = DEFAULT_BUNCH_SIZE;
using TBunchBase = TEmpty;
- template <typename TElem, typename... TRest>
+ template <typename TElem, typename... TRest>
using TContainer = TDeque<TElem, TRest...>;
static constexpr bool DeleteItems = true;
@@ -556,7 +556,7 @@ namespace NThreading {
DeclareTuneContainer(TRaFQueueSkipContainer, TContainer);
DeclareTuneValueParam(TRaFQueueDeleteItems, bool, DeleteItems);
- template <typename TItem = void, typename... TParams>
+ template <typename TItem = void, typename... TParams>
class TReadAsFilledQueue {
private:
using TTuned = TTune<NReadAsFilledPrivate::TDefaultParams, TParams...>;
@@ -565,7 +565,7 @@ namespace NThreading {
using TBunchBase = typename TTuned::TBunchBase;
- template <typename TElem, typename... TRest>
+ template <typename TElem, typename... TRest>
using TContainer =
typename TTuned::template TContainer<TElem, TRest...>;
diff --git a/library/cpp/threading/queue/mpsc_vinfarr_obstructive.h b/library/cpp/threading/queue/mpsc_vinfarr_obstructive.h
index 5f91f1b5a8..4c85bef6ec 100644
--- a/library/cpp/threading/queue/mpsc_vinfarr_obstructive.h
+++ b/library/cpp/threading/queue/mpsc_vinfarr_obstructive.h
@@ -469,7 +469,7 @@ namespace NThreading {
DeclareTuneTypeParam(TObstructiveQueueBunchBase, TBunchBase);
DeclareTuneTypeParam(TObstructiveQueueAux, TAux);
- template <typename TItem = void, typename... TParams>
+ template <typename TItem = void, typename... TParams>
class TObstructiveConsumerAuxQueue {
private:
using TTuned =
@@ -522,7 +522,7 @@ namespace NThreading {
template <typename TItem = void, bool DeleteItems = true>
class TObstructiveConsumerQueue
- : public TObstructiveConsumerAuxQueue<TItem,
- TObstructiveQueueDeleteItems<DeleteItems>> {
+ : public TObstructiveConsumerAuxQueue<TItem,
+ TObstructiveQueueDeleteItems<DeleteItems>> {
};
-}
+}
diff --git a/library/cpp/threading/queue/queue_ut.cpp b/library/cpp/threading/queue/queue_ut.cpp
index 80eca147da..a55f952cbc 100644
--- a/library/cpp/threading/queue/queue_ut.cpp
+++ b/library/cpp/threading/queue/queue_ut.cpp
@@ -12,7 +12,7 @@ private:
UNIT_TEST(Threads2_Push1M_Threads1_Pop2M)
UNIT_TEST(Threads4_Push1M_Threads1_Pop4M)
UNIT_TEST(Threads8_RndPush100K_Threads8_Queues)
- /*
+ /*
UNIT_TEST(Threads24_RndPush100K_Threads24_Queues)
UNIT_TEST(Threads24_RndPush100K_Threads8_Queues)
UNIT_TEST(Threads24_RndPush100K_Threads4_Queues)
diff --git a/library/cpp/threading/queue/tune.h b/library/cpp/threading/queue/tune.h
index 50fc3dc17c..1072342620 100644
--- a/library/cpp/threading/queue/tune.h
+++ b/library/cpp/threading/queue/tune.h
@@ -96,14 +96,14 @@
}; \
}
-#define DeclareTuneContainer(TParamName, InternalName) \
- template <template <typename, typename...> class TNewContainer> \
- struct TParamName { \
- template <typename TBase> \
- struct TApply: public TBase { \
- template <typename TElem, typename... TRest> \
- using InternalName = TNewContainer<TElem, TRest...>; \
- }; \
+#define DeclareTuneContainer(TParamName, InternalName) \
+ template <template <typename, typename...> class TNewContainer> \
+ struct TParamName { \
+ template <typename TBase> \
+ struct TApply: public TBase { \
+ template <typename TElem, typename... TRest> \
+ using InternalName = TNewContainer<TElem, TRest...>; \
+ }; \
}
namespace NTunePrivate {
diff --git a/library/cpp/threading/queue/unordered_ut.cpp b/library/cpp/threading/queue/unordered_ut.cpp
index a43b7f520e..49ebd4a1cf 100644
--- a/library/cpp/threading/queue/unordered_ut.cpp
+++ b/library/cpp/threading/queue/unordered_ut.cpp
@@ -59,9 +59,9 @@ public:
class TWorker: public ISimpleThread {
public:
TWorker(
- TQueueType* queues_,
- ui16 mine,
- TAtomic* pushDone)
+ TQueueType* queues_,
+ ui16 mine,
+ TAtomic* pushDone)
: Queues(queues_)
, MineQueue(mine)
, PushDone(pushDone)
@@ -132,7 +132,7 @@ public:
for (ui32 i = 0; i < COUNT; ++i) {
workers[i]->Join();
all.insert(all.begin(),
- workers[i]->Received.begin(), workers[i]->Received.end());
+ workers[i]->Received.begin(), workers[i]->Received.end());
}
std::sort(all.begin(), all.end());
diff --git a/library/cpp/threading/queue/ut_helpers.h b/library/cpp/threading/queue/ut_helpers.h
index 2756b52601..b017763794 100644
--- a/library/cpp/threading/queue/ut_helpers.h
+++ b/library/cpp/threading/queue/ut_helpers.h
@@ -13,11 +13,11 @@ struct TBasicReadAsFilled: public NThreading::TReadAsFilledQueue<> {
};
struct TBasicObstructiveConsumer
- : public NThreading::TObstructiveConsumerQueue<> {
+ : public NThreading::TObstructiveConsumerQueue<> {
};
struct TBasicMPSCIntrusiveUnordered
- : public NThreading::TMPSCIntrusiveUnordered {
+ : public NThreading::TMPSCIntrusiveUnordered {
};
struct TIntrusiveLink: public NThreading::TIntrusiveNode {
@@ -30,11 +30,11 @@ struct TMPMCUnorderedRing: public NThreading::TMPMCUnorderedRing {
}
};
-#define REGISTER_TESTS_FOR_ALL_ORDERED_QUEUES(TestTemplate) \
- UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicHTSwap>); \
- UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicReadAsFilled>); \
+#define REGISTER_TESTS_FOR_ALL_ORDERED_QUEUES(TestTemplate) \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicHTSwap>); \
+ UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicReadAsFilled>); \
UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicObstructiveConsumer>)
-#define REGISTER_TESTS_FOR_ALL_UNORDERED_QUEUES(TestTemplate) \
+#define REGISTER_TESTS_FOR_ALL_UNORDERED_QUEUES(TestTemplate) \
UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TBasicMPSCIntrusiveUnordered>); \
UNIT_TEST_SUITE_REGISTRATION(TestTemplate<TMPMCUnorderedRing>);