r2765 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sun Jun 22 10:10:07 CEST 2008


Author: phk
Date: 2008-06-22 10:10:05 +0200 (Sun, 22 Jun 2008)
New Revision: 2765

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
Make sure all pools have their minimum complement of threads.



Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2008-06-21 21:04:59 UTC (rev 2764)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2008-06-22 08:10:05 UTC (rev 2765)
@@ -530,13 +530,20 @@
 static void *
 wrk_herder_thread(void *priv)
 {
-	unsigned u;
+	unsigned u, w;
 
 	THR_Name("wrk_herder");
 	(void)priv;
 	while (1) {
 		for (u = 0 ; u < nwq; u++) {
 			/*
+			 * Make sure all pools have their minimum complement
+			 */
+			for (w = 0 ; w < nwq; w++) {
+				if (wq[w]->nthr < nthr_min)
+					wrk_breed_flock(wq[w]);
+			}
+			/*
 			 * We cannot avoid getting a mutex, so we have a
 			 * bogo mutex just for POSIX_STUPIDITY
 			 */




More information about the varnish-commit mailing list