diff options
author | kulikov <kulikov@yandex-team.com> | 2022-11-03 14:50:26 +0300 |
---|---|---|
committer | kulikov <kulikov@yandex-team.com> | 2022-11-03 14:50:26 +0300 |
commit | f6313e0ed2947ba490bb9b21781ec57cc839d1e9 (patch) | |
tree | a684fdf362652bfcc89f6f3d0d1c7333b9c84c12 /library/cpp/coroutine/engine/poller.cpp | |
parent | 65ab9f6a97c184f41f7a5de0b031336dd32c6d4f (diff) | |
download | ydb-f6313e0ed2947ba490bb9b21781ec57cc839d1e9.tar.gz |
,completely remove combined poller
- no significant perfomance gain by now;
- balancer doesn't use combined poller;
- tests over combined poller normally check only one part;
- poll and epoll have some differences in behaivor;
- there is probably a bug somewhere (uncaught exception on switch from poll to epoll).
Diffstat (limited to 'library/cpp/coroutine/engine/poller.cpp')
-rw-r--r-- | library/cpp/coroutine/engine/poller.cpp | 50 |
1 files changed, 10 insertions, 40 deletions
diff --git a/library/cpp/coroutine/engine/poller.cpp b/library/cpp/coroutine/engine/poller.cpp index 61164fa56b..bcd31d209c 100644 --- a/library/cpp/coroutine/engine/poller.cpp +++ b/library/cpp/coroutine/engine/poller.cpp @@ -310,43 +310,6 @@ namespace { TPollVec T_; }; - - class TCombinedPoller { - typedef TPoller<TPollerImpl<TWithoutLocking>> TDefaultPoller; - - public: - TCombinedPoller() { - P_.Reset(new TPollPoller()); - } - - void Set(const TChange& c) { - if (!P_) { - D_->Set(c); - } else { - P_->Set(c); - } - } - - void Wait(TEvents& events, TInstant deadLine) { - if (!P_) { - D_->Wait(events, deadLine); - } else { - if (P_->Size() > 200) { - D_.Reset(new TDefaultPoller()); - P_->Build(*D_); - P_.Destroy(); - D_->Wait(events, deadLine); - } else { - P_->Wait(events, deadLine); - } - } - } - - private: - THolder<TPollPoller> P_; - THolder<TDefaultPoller> D_; - }; - struct TUserPoller: public TString { TUserPoller() : TString(GetEnv("USER_POLLER")) @@ -364,10 +327,17 @@ THolder<IPollerFace> IPollerFace::Construct(TStringBuf name) { } THolder<IPollerFace> IPollerFace::Construct(EContPoller poller) { + if (poller == EContPoller::Default) { +#if defined (HAVE_EPOLL_POLLER) + poller = EContPoller::Epoll; +#elif defined(HAVE_KQUEUE_POLLER) + poller = EContPoller::Kqueue; +#else + poller = EContPoller::Select; +#endif + } + switch (poller) { - case EContPoller::Default: - case EContPoller::Combined: - return MakeHolder<TVirtualize<TCombinedPoller>>(EContPoller::Combined); case EContPoller::Select: return MakeHolder<TVirtualize<TPoller<TGenericPoller<TSelectPoller<TWithoutLocking>>>>>(poller); case EContPoller::Poll: |