diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-07-23 13:42:54 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:32 +0000 |
commit | 0d1034d2ea5913e14317c68908e27640d1d8ae36 (patch) | |
tree | ec9598099d58944a9741339a1e2bfe1950d2d780 /bitbake/lib/bb/runqueue.py | |
parent | 384c5cc8ac5dfd8132887603fc7eb54f2321664b (diff) | |
download | poky-0d1034d2ea5913e14317c68908e27640d1d8ae36.tar.gz |
Let the RunQueueScheduler control the number of active tasks
(Bitbake rev: 1387423e747f59866fd1cb99a7d90605e668823f)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index a1f79e9f03..3a630e02a2 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -96,12 +96,13 @@ class RunQueueScheduler(object): | |||
96 | """ | 96 | """ |
97 | Return the id of the first task we find that is buildable | 97 | Return the id of the first task we find that is buildable |
98 | """ | 98 | """ |
99 | for task1 in range(len(self.rqdata.runq_fnid)): | 99 | if self.rq.stats.active < self.rq.number_tasks: |
100 | task = self.prio_map[task1] | 100 | for task1 in range(len(self.rqdata.runq_fnid)): |
101 | if self.rq.runq_running[task] == 1: | 101 | task = self.prio_map[task1] |
102 | continue | 102 | if self.rq.runq_running[task] == 1: |
103 | if self.rq.runq_buildable[task] == 1: | 103 | continue |
104 | return task | 104 | if self.rq.runq_buildable[task] == 1: |
105 | return task | ||
105 | 106 | ||
106 | class RunQueueSchedulerSpeed(RunQueueScheduler): | 107 | class RunQueueSchedulerSpeed(RunQueueScheduler): |
107 | """ | 108 | """ |
@@ -1267,10 +1268,7 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
1267 | # nothing to do | 1268 | # nothing to do |
1268 | self.rq.state = runQueueCleanUp | 1269 | self.rq.state = runQueueCleanUp |
1269 | 1270 | ||
1270 | task = None | 1271 | for task in iter(self.sched.next, None): |
1271 | if self.stats.active < self.number_tasks: | ||
1272 | task = self.sched.next() | ||
1273 | if task is not None: | ||
1274 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] | 1272 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] |
1275 | 1273 | ||
1276 | taskname = self.rqdata.runq_task[task] | 1274 | taskname = self.rqdata.runq_task[task] |
@@ -1306,8 +1304,6 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
1306 | self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData) | 1304 | self.build_pipes[pid] = runQueuePipe(pipein, pipeout, self.cfgData) |
1307 | self.runq_running[task] = 1 | 1305 | self.runq_running[task] = 1 |
1308 | self.stats.taskActive() | 1306 | self.stats.taskActive() |
1309 | if self.stats.active < self.number_tasks: | ||
1310 | return True | ||
1311 | 1307 | ||
1312 | for pipe in self.build_pipes: | 1308 | for pipe in self.build_pipes: |
1313 | self.build_pipes[pipe].read() | 1309 | self.build_pipes[pipe].read() |