aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/ev_poll_posix.cc
diff options
context:
space:
mode:
authorGravatar Guantao Liu <guantaol@google.com>2019-01-07 18:22:50 -0800
committerGravatar Guantao Liu <guantaol@google.com>2019-01-07 18:22:50 -0800
commit11eff929e24cae59ed21c2f3a0bde22a6dbe0d91 (patch)
tree7f540f95825292ef732f7e35a3e646c9dbf56c6c /src/core/lib/iomgr/ev_poll_posix.cc
parent8dcda4dc36aa4e4d3a4c46023f6470b4c1ec7bca (diff)
Avoid the thread jump in server callback APIs.
Add a utility function in iomgr to check whether the caller thread is a worker for any background poller, and keep grpc combiner from offloading closures to the default executor if the current thread is a worker for any background poller.
Diffstat (limited to 'src/core/lib/iomgr/ev_poll_posix.cc')
-rw-r--r--src/core/lib/iomgr/ev_poll_posix.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc
index 67cbfbbd02..c479206410 100644
--- a/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/src/core/lib/iomgr/ev_poll_posix.cc
@@ -1782,6 +1782,8 @@ static void global_cv_fd_table_shutdown() {
* event engine binding
*/
+static bool is_any_background_poller_thread(void) { return false; }
+
static void shutdown_background_closure(void) {}
static void shutdown_engine(void) {
@@ -1828,6 +1830,7 @@ static const grpc_event_engine_vtable vtable = {
pollset_set_add_fd,
pollset_set_del_fd,
+ is_any_background_poller_thread,
shutdown_background_closure,
shutdown_engine,
};