summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-04 07:09:00 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-04 07:09:00 +0000
commitf7286cf589e0588b1f41961762396cc4e8032e62 (patch)
treee2a961ce29fdcd07e52700ed6fdb2d74458ad83f
parent49766b22882fc216dcf884fa5c13cc82979f9330 (diff)
downloadportage-f7286cf589e0588b1f41961762396cc4e8032e62.tar.gz
portage-f7286cf589e0588b1f41961762396cc4e8032e62.tar.bz2
portage-f7286cf589e0588b1f41961762396cc4e8032e62.zip
Create a Scheduler._task_queues attribute which has "build" and "prefetch"
queues. The build queue is currently unused and the prefetch queue is used for parallel fetch. svn path=/main/trunk/; revision=10922
-rw-r--r--pym/_emerge/__init__.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index a903e52a6..e48aee781 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -7113,10 +7113,12 @@ class Scheduler(object):
except AttributeError:
self._poll = PollSelectFallback()
- self._prefetch_queue = SequentialTaskQueue()
- self._add_task = self._prefetch_queue.add
- self._schedule_tasks = self._prefetch_queue.schedule
+ self._task_queues = slot_dict_class(("build", "prefetch"), prefix="")
+ for k in self._task_queues.allowed_keys:
+ setattr(self._task_queues, k, SequentialTaskQueue())
+ self._add_task = self._task_queues.prefetch.add
+ self._schedule_tasks = self._task_queues.prefetch.schedule
self._prefetchers = weakref.WeakValueDictionary()
self._failed_fetches = []
self._parallel_fetch = False
@@ -7422,7 +7424,7 @@ class Scheduler(object):
return e.status
finally:
# clean up child process if necessary
- self._prefetch_queue.clear()
+ self._task_queues.prefetch.clear()
return os.EX_OK
def _save_resume_list(self):