From 11eff929e24cae59ed21c2f3a0bde22a6dbe0d91 Mon Sep 17 00:00:00 2001 From: Guantao Liu Date: Mon, 7 Jan 2019 18:22:50 -0800 Subject: 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. --- src/core/lib/iomgr/ev_epoll1_linux.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/lib/iomgr/ev_epoll1_linux.cc') diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 4b8c891e9b..9eb4c089d8 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -1242,6 +1242,8 @@ static void pollset_set_del_pollset_set(grpc_pollset_set* bag, * Event engine binding */ +static bool is_any_background_poller_thread(void) { return false; } + static void shutdown_background_closure(void) {} static void shutdown_engine(void) { @@ -1287,6 +1289,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, }; -- cgit v1.2.3