From 329f3e159e2a1af75184db50b5a539c5e4c5ab79 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 17 Sep 2006 18:30:05 +0000 Subject: [PATCH] Use the worker pools in round-robin fashion. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1049 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_pool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 04a815a1..934bee12 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -238,9 +238,15 @@ WRK_QueueSession(struct sess *sp) struct worker *w; pthread_t tp; struct wq *qp; + static unsigned nq; + unsigned onq; + onq = nq + 1; + if (onq > nwq) + onq = 0; sp->workreq.sess = sp; - qp = wq[sp->fd % nwq]; + qp = wq[onq]; + nq = onq; LOCK(&qp->mtx); -- 2.39.5