All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cooker: Only start as many parse threads as we need
@ 2016-01-31 13:31 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-01-31 13:31 UTC (permalink / raw)
  To: bitbake-devel

If we're only going to parse one recipe, no point in starting 
a large number of threads.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index a1182ef..1f4174f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1986,8 +1986,6 @@ class CookerParser(object):
         self.total = len(filelist)
 
         self.current = 0
-        self.num_processes = int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or
-                                 multiprocessing.cpu_count())
         self.process_names = []
 
         self.bb_cache = bb.cache.Cache(self.cfgdata, self.cfghash, cooker.caches_array)
@@ -2002,6 +2000,9 @@ class CookerParser(object):
         self.toparse = self.total - len(self.fromcache)
         self.progress_chunk = max(self.toparse / 100, 1)
 
+        self.num_processes = min(int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS", True) or
+                                 multiprocessing.cpu_count()), len(self.willparse))
+
         self.start()
         self.haveshutdown = False
 




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-31 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-31 13:31 [PATCH] cooker: Only start as many parse threads as we need Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.