r1049 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Sep 17 20:30:05 CEST 2006


Author: phk
Date: 2006-09-17 20:30:05 +0200 (Sun, 17 Sep 2006)
New Revision: 1049

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
Use the worker pools in round-robin fashion.


Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-17 09:26:24 UTC (rev 1048)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-09-17 18:30:05 UTC (rev 1049)
@@ -238,9 +238,15 @@
 	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);
 




More information about the varnish-commit mailing list