From b0ce25e705f935e70f0840c3ba3436067553f6e2 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 8 Sep 2017 14:42:26 -0700 Subject: [PATCH] Add comment --- src/core/lib/iomgr/executor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/lib/iomgr/executor.c b/src/core/lib/iomgr/executor.c index a41c43edfd2..6e8c896ed6e 100644 --- a/src/core/lib/iomgr/executor.c +++ b/src/core/lib/iomgr/executor.c @@ -230,6 +230,10 @@ static void executor_push(grpc_exec_ctx *exec_ctx, grpc_closure *closure, } gpr_mu_lock(&ts->mu); if (ts->queued_long_job) { + // if there's a long job queued, we never queue anything else to this + // queue (since long jobs can take 'infinite' time and we need to + // guarantee no starvation) + // ... spin through queues and try again gpr_mu_unlock(&ts->mu); size_t idx = (size_t)(ts - g_thread_state); ts = &g_thread_state[(idx + 1) % cur_thread_count];