aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/queue
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/threading/queue
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/queue')
-rw-r--r--library/cpp/threading/queue/basic_ut.cpp12
-rw-r--r--library/cpp/threading/queue/mpsc_read_as_filled.h2
-rw-r--r--library/cpp/threading/queue/queue_ut.cpp38
-rw-r--r--library/cpp/threading/queue/unordered_ut.cpp22
4 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/threading/queue/basic_ut.cpp b/library/cpp/threading/queue/basic_ut.cpp
index f6b8d0f810..5f56f8583e 100644
--- a/library/cpp/threading/queue/basic_ut.cpp
+++ b/library/cpp/threading/queue/basic_ut.cpp
@@ -4,10 +4,10 @@
#include "ut_helpers.h"
-template <typename TQueueType>
+template <typename TQueueType>
class TQueueTestsInSingleThread: public TTestBase {
private:
- using TSelf = TQueueTestsInSingleThread<TQueueType>;
+ using TSelf = TQueueTestsInSingleThread<TQueueType>;
using TLink = TIntrusiveLink;
UNIT_TEST_SUITE_DEMANGLE(TSelf);
@@ -18,7 +18,7 @@ private:
public:
void OnePushOnePop() {
- TQueueType queue;
+ TQueueType queue;
auto popped = queue.Pop();
UNIT_ASSERT_VALUES_EQUAL(popped, nullptr);
@@ -33,7 +33,7 @@ public:
};
void OnePushOnePop_Repeat1M() {
- TQueueType queue;
+ TQueueType queue;
TLink msg;
auto popped = queue.Pop();
@@ -54,7 +54,7 @@ public:
class TCycleThread: public ISimpleThread {
public:
void* ThreadProc() override {
- TQueueType queue;
+ TQueueType queue;
TLink msg;
auto popped = queue.Pop();
UNIT_ASSERT_VALUES_EQUAL(popped, nullptr);
@@ -71,7 +71,7 @@ public:
}
};
- TVector<TAutoPtr<TCycleThread>> cyclers;
+ TVector<TAutoPtr<TCycleThread>> cyclers;
for (size_t i = 0; i < NUMBER_OF_THREADS; ++i) {
cyclers.emplace_back(new TCycleThread);
diff --git a/library/cpp/threading/queue/mpsc_read_as_filled.h b/library/cpp/threading/queue/mpsc_read_as_filled.h
index de8f596833..be33ba5a58 100644
--- a/library/cpp/threading/queue/mpsc_read_as_filled.h
+++ b/library/cpp/threading/queue/mpsc_read_as_filled.h
@@ -544,7 +544,7 @@ namespace NThreading {
using TBunchBase = TEmpty;
template <typename TElem, typename... TRest>
- using TContainer = TDeque<TElem, TRest...>;
+ using TContainer = TDeque<TElem, TRest...>;
static constexpr bool DeleteItems = true;
};
diff --git a/library/cpp/threading/queue/queue_ut.cpp b/library/cpp/threading/queue/queue_ut.cpp
index 299025adcc..80eca147da 100644
--- a/library/cpp/threading/queue/queue_ut.cpp
+++ b/library/cpp/threading/queue/queue_ut.cpp
@@ -5,10 +5,10 @@
typedef void* TMsgLink;
-template <typename TQueueType>
+template <typename TQueueType>
class TQueueTestProcs: public TTestBase {
private:
- UNIT_TEST_SUITE_DEMANGLE(TQueueTestProcs<TQueueType>);
+ UNIT_TEST_SUITE_DEMANGLE(TQueueTestProcs<TQueueType>);
UNIT_TEST(Threads2_Push1M_Threads1_Pop2M)
UNIT_TEST(Threads4_Push1M_Threads1_Pop4M)
UNIT_TEST(Threads8_RndPush100K_Threads8_Queues)
@@ -21,7 +21,7 @@ private:
public:
void Push1M_Pop1M() {
- TQueueType queue;
+ TQueueType queue;
TMsgLink msg = &queue;
auto pmsg = queue.Pop();
@@ -41,17 +41,17 @@ public:
}
void Threads2_Push1M_Threads1_Pop2M() {
- TQueueType queue;
+ TQueueType queue;
class TPusherThread: public ISimpleThread {
public:
- TPusherThread(TQueueType& theQueue, char* start)
- : Queue(theQueue)
+ TPusherThread(TQueueType& theQueue, char* start)
+ : Queue(theQueue)
, Arg(start)
{
}
- TQueueType& Queue;
+ TQueueType& Queue;
char* Arg;
void* ThreadProc() override {
@@ -79,17 +79,17 @@ public:
}
void Threads4_Push1M_Threads1_Pop4M() {
- TQueueType queue;
+ TQueueType queue;
class TPusherThread: public ISimpleThread {
public:
- TPusherThread(TQueueType& theQueue, char* start)
- : Queue(theQueue)
+ TPusherThread(TQueueType& theQueue, char* start)
+ : Queue(theQueue)
, Arg(start)
{
}
- TQueueType& Queue;
+ TQueueType& Queue;
char* Arg;
void* ThreadProc() override {
@@ -122,17 +122,17 @@ public:
template <size_t NUMBER_OF_PUSHERS, size_t NUMBER_OF_QUEUES>
void ManyRndPush100K_ManyQueues() {
- TQueueType queue[NUMBER_OF_QUEUES];
+ TQueueType queue[NUMBER_OF_QUEUES];
class TPusherThread: public ISimpleThread {
public:
- TPusherThread(TQueueType* queues, char* start)
+ TPusherThread(TQueueType* queues, char* start)
: Queues(queues)
, Arg(start)
{
}
- TQueueType* Queues;
+ TQueueType* Queues;
char* Arg;
void* ThreadProc() override {
@@ -157,13 +157,13 @@ public:
class TPopperThread: public ISimpleThread {
public:
- TPopperThread(TQueueType* theQueue, char* base)
- : Queue(theQueue)
+ TPopperThread(TQueueType* theQueue, char* base)
+ : Queue(theQueue)
, Base(base)
{
}
- TQueueType* Queue;
+ TQueueType* Queue;
char* Base;
void* ThreadProc() override {
@@ -197,8 +197,8 @@ public:
}
};
- TVector<TAutoPtr<TPopperThread>> poppers;
- TVector<TAutoPtr<TPusherThread>> pushers;
+ TVector<TAutoPtr<TPopperThread>> poppers;
+ TVector<TAutoPtr<TPusherThread>> pushers;
for (size_t i = 0; i < NUMBER_OF_QUEUES; ++i) {
poppers.emplace_back(new TPopperThread(&queue[i], (char*)&queue));
diff --git a/library/cpp/threading/queue/unordered_ut.cpp b/library/cpp/threading/queue/unordered_ut.cpp
index 494cffcbe5..a43b7f520e 100644
--- a/library/cpp/threading/queue/unordered_ut.cpp
+++ b/library/cpp/threading/queue/unordered_ut.cpp
@@ -6,19 +6,19 @@
#include "ut_helpers.h"
-template <typename TQueueType>
+template <typename TQueueType>
class TTestUnorderedQueue: public TTestBase {
private:
using TLink = TIntrusiveLink;
- UNIT_TEST_SUITE_DEMANGLE(TTestUnorderedQueue<TQueueType>);
+ UNIT_TEST_SUITE_DEMANGLE(TTestUnorderedQueue<TQueueType>);
UNIT_TEST(Push1M_Pop1M_Unordered)
UNIT_TEST_SUITE_END();
public:
void Push1M_Pop1M_Unordered() {
constexpr int REPEAT = 1000000;
- TQueueType queue;
+ TQueueType queue;
TLink msg[REPEAT];
auto pmsg = queue.Pop();
@@ -28,7 +28,7 @@ public:
queue.Push(&msg[i]);
}
- TVector<TLink*> popped;
+ TVector<TLink*> popped;
popped.reserve(REPEAT);
for (int i = 0; i < REPEAT; ++i) {
popped.push_back((TLink*)queue.Pop());
@@ -44,17 +44,17 @@ public:
}
};
-template <typename TQueueType>
+template <typename TQueueType>
class TTestWeakQueue: public TTestBase {
private:
- UNIT_TEST_SUITE_DEMANGLE(TTestWeakQueue<TQueueType>);
+ UNIT_TEST_SUITE_DEMANGLE(TTestWeakQueue<TQueueType>);
UNIT_TEST(Threads8_Rnd_Exchange)
UNIT_TEST_SUITE_END();
public:
template <ui16 COUNT = 48, ui32 MSG_COUNT = 10000>
void ManyThreadsRndExchange() {
- TQueueType queues[COUNT];
+ TQueueType queues[COUNT];
class TWorker: public ISimpleThread {
public:
@@ -68,9 +68,9 @@ public:
{
}
- TQueueType* Queues;
+ TQueueType* Queues;
ui16 MineQueue;
- TVector<uintptr_t> Received;
+ TVector<uintptr_t> Received;
TAtomic* PushDone;
void* ThreadProc() override {
@@ -120,7 +120,7 @@ public:
}
};
- TVector<TAutoPtr<TWorker>> workers;
+ TVector<TAutoPtr<TWorker>> workers;
TAtomic pushDone = 0;
for (ui32 i = 0; i < COUNT; ++i) {
@@ -128,7 +128,7 @@ public:
workers.back()->Start();
}
- TVector<uintptr_t> all;
+ TVector<uintptr_t> all;
for (ui32 i = 0; i < COUNT; ++i) {
workers[i]->Join();
all.insert(all.begin(),