Mercurial > hg > Game > Cerium
diff TaskManager/Fifo/FifoTaskManagerImpl.cc @ 1077:325b6c6d7d65 draft
use one activeTaskQueue
author | yutaka@localhost.localdomain |
---|---|
date | Fri, 17 Dec 2010 02:23:09 +0900 |
parents | 5ad8fb1dc70f |
children | 6dabcd1a9ccf |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Fri Dec 17 00:23:52 2010 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Fri Dec 17 02:23:09 2010 +0900 @@ -65,6 +65,7 @@ taskQueueImpl = tm-> taskQueueImpl ; htaskImpl = tm-> htaskImpl ; waitTaskQueue = tm->waitTaskQueue; + activeTaskQueue = tm->activeTaskQueue; taskListInfo = new QueueInfo<TaskList>(taskListPool); ppeTaskList = new QueueInfo<TaskList>(taskListPool); @@ -87,18 +88,26 @@ * 実行タスクリストに入れる */ void -FifoTaskManagerImpl::set_runTaskList() +FifoTaskManagerImpl::set_runTaskList(QueueInfo<HTask> *activeTaskQueue) { // printf("active task queue length = %d\n",activeTaskQueue->length()); - while (HTaskPtr htask = activeTaskQueue->poll()) { + HTaskPtr htask = activeTaskQueue->getFirst(); + while (htask != NULL) { + if (htask->cpu_type == CPU_PPE) { set_taskList(htask, taskListInfo ); + HTaskPtr next = activeTaskQueue->getNext(htask); + activeTaskQueue->remove(htask); + htask = next; + } else { + htask = activeTaskQueue->getNext(htask); + } } } void FifoTaskManagerImpl::poll() { - set_runTaskList(); + set_runTaskList(activeTaskQueue); // list を実行する sendTaskList(); // ppe scheduler からの mail を調べる