diff options
author | Vijay Pai <vpai@google.com> | 2015-10-14 15:29:20 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-10-14 15:29:20 -0700 |
commit | 881c63ee3add266827254bc3aeda7a599b5157c5 (patch) | |
tree | 055f7f03b9cdf438dc5e474f11da363e3650aa01 /src | |
parent | 05bdfdc77f99e7e05fd8ec8f687cd1943c4600f0 (diff) | |
parent | 2783ced6f48afa70d339172e1d5a6beca51957b2 (diff) |
Merge pull request #3786 from ctiller/try-this-simple-trick-to-double-performance
Set current worker for longer
Diffstat (limited to 'src')
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index c4e1987491..bce1ce9714 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -280,16 +280,15 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, if (!added_worker) { push_front_worker(pollset, worker); added_worker = 1; + gpr_tls_set(&g_current_thread_worker, (gpr_intptr)worker); } gpr_tls_set(&g_current_thread_poller, (gpr_intptr)pollset); - gpr_tls_set(&g_current_thread_worker, (gpr_intptr)worker); GPR_TIMER_BEGIN("maybe_work_and_unlock", 0); pollset->vtable->maybe_work_and_unlock(exec_ctx, pollset, worker, deadline, now); GPR_TIMER_END("maybe_work_and_unlock", 0); locked = 0; gpr_tls_set(&g_current_thread_poller, 0); - gpr_tls_set(&g_current_thread_worker, 0); } else { pollset->kicked_without_pollers = 0; } @@ -319,6 +318,7 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, } if (added_worker) { remove_worker(pollset, worker); + gpr_tls_set(&g_current_thread_worker, 0); } grpc_wakeup_fd_destroy(&worker->wakeup_fd); if (pollset->shutting_down) { |