Mercurial > hg > Game > Cerium
changeset 809:13c736659c63 draft
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 May 2010 23:23:29 +0900 |
parents | 3c404a32719c |
children | 8da9a7b5da0a a939e4d6fe5f |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Makefile.def TaskManager/kernel/ppe/TaskList.h TaskManager/kernel/ppe/TaskListInfo.cc TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h |
diffstat | 7 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Sat May 22 23:23:29 2010 +0900 @@ -215,6 +215,7 @@ taskListInfo[id] = speTaskList[id]; speTaskList[id] = tmp; + tmp->getLast()->next = 0; speThreads->send_mail(id, 1, (memaddr *)tmp->getFirst()); }
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Sat May 22 23:23:29 2010 +0900 @@ -16,7 +16,6 @@ { delete mainScheduler; - delete taskListImpl ; delete taskQueueImpl ; delete htaskImpl ; @@ -59,7 +58,6 @@ mainScheduler->init(this); set_scheduler(mainScheduler); - taskListImpl = tm-> taskListImpl ; taskQueueImpl = tm-> taskQueueImpl ; htaskImpl = tm-> htaskImpl ; waitTaskQueue = tm->waitTaskQueue; @@ -107,7 +105,7 @@ { do { poll(); - } while(!taskListInfo->empty()) ; + } while(!activeTaskQueue->empty()) ; if (!waitTaskQueue->empty()) { get_scheduler()->printf("Dead lock detected\n"); @@ -127,6 +125,7 @@ TaskListInfoPtr tmp = ppeTaskList; ppeTaskList = taskListInfo; taskListInfo = tmp; + ppeTaskList->getLast()->next = 0; // TaskList のアドレスを送る mainScheduler->mail_write_from_host((memaddr)ppeTaskList->getFirst());
--- a/TaskManager/Makefile.def Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/Makefile.def Sat May 22 23:23:29 2010 +0900 @@ -29,8 +29,8 @@ ABIBIT = 32 -OPT = -O9 -#OPT = -g +# OPT = -O9 +OPT = -g CC = g++ CFLAGS = -Wall `sdl-config --cflags` -m$(ABIBIT) $(OPT)
--- a/TaskManager/kernel/ppe/TaskList.h Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskList.h Sat May 22 23:23:29 2010 +0900 @@ -17,6 +17,7 @@ TaskList *waiter; // 4 byte SimpleTask tasks[TASK_MAX_SIZE]; // 24*TASK_MAX_SIZE + void init() { length = 0; } }; typedef TaskList* TaskListPtr;
--- a/TaskManager/kernel/ppe/TaskListInfo.cc Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskListInfo.cc Sat May 22 23:23:29 2010 +0900 @@ -55,6 +55,7 @@ taskListPool.extend_pool(64); q = taskListPool.poll(); } + q->init(); return q; } @@ -70,6 +71,7 @@ TaskListInfo::freeAll() { TaskListPtr t; + if (getLast()->next==0) getLast()->next = this; while((t=poll())) free_(t); }
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Sat May 22 23:23:29 2010 +0900 @@ -180,14 +180,19 @@ void TaskManagerImpl::set_taskList(HTaskPtr htask, TaskListInfoPtr taskList) { - TaskListPtr list = taskList->getLast(); + TaskListPtr list ; + if ( taskList->empty() ) { + list = taskList->create(); + taskList->addLast(list); + } else + list = taskList->getLast(); SimpleTaskPtr task = &list->tasks[list->length++]; if (htask->command==TaskArray1) { // compatibility int next = ((htask->r_size)/sizeof(SimpleTask))+1; if (list->length+next>=TASK_MAX_SIZE) { list->length--; - TaskListPtr newList = taskListImpl->create(); + TaskListPtr newList = taskList->create(); taskList->addLast(newList); list = newList; task = &list->tasks[list->length++]; @@ -205,7 +210,7 @@ *task = *(SimpleTask*)htask; } if (list->length >= TASK_MAX_SIZE) { - TaskListPtr newList = taskListImpl->create(); + TaskListPtr newList = taskList->create(); taskList->addLast(newList); list = newList; }
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h Sat May 22 22:32:41 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.h Sat May 22 23:23:29 2010 +0900 @@ -18,7 +18,6 @@ HTaskInfo *activeTaskQueue; HTaskInfo *waitTaskQueue; - TaskListInfo *taskListImpl; TaskQueueInfo *taskQueueImpl; HTaskInfo *htaskImpl;