From f7286cf589e0588b1f41961762396cc4e8032e62 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 4 Jul 2008 07:09:00 +0000 Subject: [PATCH] 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 --- pym/_emerge/__init__.py | 10 ++++++---- 1 file 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): -- 2.26.2