aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/coroutine/engine/poller.cpp
diff options
context:
space:
mode:
authorkulikov <kulikov@yandex-team.com>2022-11-03 14:50:26 +0300
committerkulikov <kulikov@yandex-team.com>2022-11-03 14:50:26 +0300
commitf6313e0ed2947ba490bb9b21781ec57cc839d1e9 (patch)
treea684fdf362652bfcc89f6f3d0d1c7333b9c84c12 /library/cpp/coroutine/engine/poller.cpp
parent65ab9f6a97c184f41f7a5de0b031336dd32c6d4f (diff)
downloadydb-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.cpp50
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: