VSL(SLT_WorkThread, 0, "%p start", w);
LOCK(&tmtx);
- VSL_stats->n_wrk_busy++;
VSL_stats->n_wrk_create++;
UNLOCK(&tmtx);
while (1) {
TAILQ_INSERT_HEAD(&qp->idle, w, list);
assert(w->idle != 0);
UNLOCK(&qp->mtx);
- LOCK(&tmtx);
- VSL_stats->n_wrk_busy--;
- UNLOCK(&tmtx);
assert(1 == read(w->pipe[0], &c, 1));
if (w->idle == 0)
break;
UNLOCK(&qp->mtx);
w->wrq = &sp->workreq;
assert(1 == write(w->pipe[1], w, 1));
- LOCK(&tmtx);
- VSL_stats->n_wrk_busy++;
- UNLOCK(&tmtx);
return;
}
MAC_STAT(n_wrk_create, uint64_t, "u", "N worker threads created")
MAC_STAT(n_wrk_failed, uint64_t, "u", "N worker threads not created")
MAC_STAT(n_wrk_max, uint64_t, "u", "N worker threads limited")
-MAC_STAT(n_wrk_busy, uint64_t, "u", "N busy worker threads")
MAC_STAT(n_wrk_queue, uint64_t, "u", "N queued work requests")
MAC_STAT(n_wrk_overflow, uint64_t, "u", "N overflowed work requests")