diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-07-23 13:42:54 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-08-11 11:43:31 -0700 |
commit | 1387423e747f59866fd1cb99a7d90605e668823f (patch) | |
tree | 6ff6afbaababf6467c4339b063abd3812e34f995 /lib/bb/runqueue.py | |
parent | 4dd38d5cfb80f9bb72bc41a629c3320b38f7314d (diff) | |
download | bitbake-1387423e747f59866fd1cb99a7d90605e668823f.tar.gz |
Let the RunQueueScheduler control the number of active tasks
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/runqueue.py')
-rw-r--r-- | lib/bb/runqueue.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index f11c94122..76935e6e6 100644 --- a/lib/bb/runqueue.py +++ b/lib/bb/runqueue.py @@ -91,12 +91,13 @@ class RunQueueScheduler(object): """ Return the id of the first task we find that is buildable """ - for task1 in range(len(self.rq.runq_fnid)): - task = self.prio_map[task1] - if self.rq.runq_running[task] == 1: - continue - if self.rq.runq_buildable[task] == 1: - return task + if self.rq.stats.active < self.rq.number_tasks: + for task1 in range(len(self.rq.runq_fnid)): + task = self.prio_map[task1] + if self.rq.runq_running[task] == 1: + continue + if self.rq.runq_buildable[task] == 1: + return task class RunQueueSchedulerSpeed(RunQueueScheduler): """ @@ -956,10 +957,7 @@ class RunQueue: self.state = runQueueCleanUp while True: - task = None - if self.stats.active < self.number_tasks: - task = self.sched.next() - if task is not None: + for task in iter(self.sched.next, None): fn = self.taskData.fn_index[self.runq_fnid[task]] taskname = self.runq_task[task] @@ -978,8 +976,6 @@ class RunQueue: self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData) self.runq_running[task] = 1 self.stats.taskActive() - if self.stats.active < self.number_tasks: - continue for pipe in self.build_pipes: self.build_pipes[pipe].read() |