6
6
#include < ydb/library/actors/util/datetime.h>
7
7
8
8
namespace NActors {
9
- TIOExecutorPool::TIOExecutorPool (ui32 poolId, ui32 threads, const TString& poolName, TAffinity* affinity)
10
- : TExecutorPoolBase(poolId, threads, affinity)
9
+ TIOExecutorPool::TIOExecutorPool (ui32 poolId, ui32 threads, const TString& poolName, TAffinity* affinity, bool useRingQueue )
10
+ : TExecutorPoolBase(poolId, threads, affinity, useRingQueue )
11
11
, Threads(new TExecutorThreadCtx[threads])
12
12
, PoolName(poolName)
13
13
{}
@@ -17,7 +17,8 @@ namespace NActors {
17
17
cfg.PoolId,
18
18
cfg.Threads,
19
19
cfg.PoolName,
20
- new TAffinity(cfg.Affinity)
20
+ new TAffinity(cfg.Affinity),
21
+ cfg.UseRingQueue
21
22
)
22
23
{
23
24
Harmonizer = harmonizer;
@@ -53,7 +54,7 @@ namespace NActors {
53
54
}
54
55
55
56
while (!StopFlag.load (std::memory_order_acquire)) {
56
- if (const ui32 activation = Activations .Pop (++revolvingCounter)) {
57
+ if (const ui32 activation = std::visit ([&revolvingCounter]( auto &x){ return x .Pop (++revolvingCounter);}, Activations )) {
57
58
return activation;
58
59
}
59
60
SpinLockPause ();
@@ -86,7 +87,9 @@ namespace NActors {
86
87
}
87
88
88
89
void TIOExecutorPool::ScheduleActivationEx (ui32 activation, ui64 revolvingWriteCounter) {
89
- Activations.Push (activation, revolvingWriteCounter);
90
+ std::visit ([activation, revolvingWriteCounter](auto &x) {
91
+ x.Push (activation, revolvingWriteCounter);
92
+ }, Activations);
90
93
const TAtomic x = AtomicIncrement (Semaphore);
91
94
if (x <= 0 ) {
92
95
for (;; ++revolvingWriteCounter) {
0 commit comments