]> err.no Git - varnish/commitdiff
Use the worker pools in round-robin fashion.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 17 Sep 2006 18:30:05 +0000 (18:30 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 17 Sep 2006 18:30:05 +0000 (18:30 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1049 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pool.c

index 04a815a152194c13e46bb90ba58798c8413a9f52..934bee12212ee570b069e2384a6686449948ec6e 100644 (file)
@@ -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);