Add in a racy check for min deadline in run_some_expired_alarms before

attempting
the trylock. This shaves the number of g_mu and g_checker_mu uses dramatically in perf test workload and all tests still pass.
pull/1180/head
Vijay Pai 10 years ago
parent 7d3d9ca24c
commit 74c14e5ac7
  1. 4
      src/core/iomgr/alarm.c

@ -307,6 +307,10 @@ static int run_some_expired_alarms(gpr_mu *drop_mu, gpr_timespec now,
/* TODO(ctiller): verify that there are any alarms (atomically) here */
if (gpr_time_cmp(g_shard_queue[0]->min_deadline, now) >= 0) {
return 0;
}
if (gpr_mu_trylock(&g_checker_mu)) {
gpr_mu_lock(&g_mu);

Loading…
Cancel
Save