Mercurial > hg > Game > Cerium
changeset 476:5fc79ff9c257 draft
CellBufferManager removed
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 04 Oct 2009 11:47:46 +0900 |
parents | 4e0308d2ba73 |
children | 6e0913b80c93 b31019c79c34 |
files | TaskManager/Cell/CellBufferManager.cc TaskManager/Cell/CellBufferManager.h TaskManager/Cell/CellTaskManagerImpl.cc |
diffstat | 3 files changed, 19 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellBufferManager.cc Sun Oct 04 11:29:50 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#include "CellBufferManager.h" -#include "CellTaskListInfo.h" -#include "CellHTaskInfo.h" - -void -CellBufferManager::init(void) -{ - BufferManager::init(); - - // なんつーか。。。 - // おかしいよな・・・ - delete taskListImpl; - taskListImpl = new CellTaskListInfo; - taskListImpl->init(machineNum*2); - - delete htaskImpl; - htaskImpl = new CellHTaskInfo; - htaskImpl->init(TASK_MAX_SIZE*2); -}
--- a/TaskManager/Cell/CellBufferManager.h Sun Oct 04 11:29:50 2009 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#ifndef INCLUDED_CELL_BUFFER_MANAGER -#define INCLUDED_CELL_BUFFER_MANAGER - -#include "base.h" -#include "BufferManager.h" - -class CellBufferManager : public BufferManager { -public: - CellBufferManager(int num) :BufferManager(num){} - - BASE_NEW_DELETE(CellBufferManager); - - void init(void); -}; - -#endif
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sun Oct 04 11:29:50 2009 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Sun Oct 04 11:47:46 2009 +0900 @@ -4,7 +4,8 @@ #include <stdlib.h> #include <string.h> #include "CellTaskManagerImpl.h" -#include "CellBufferManager.h" +#include "CellTaskListInfo.h" +#include "CellHTaskInfo.h" #include "PpeScheduler.h" #include "types.h" @@ -26,27 +27,33 @@ void CellTaskManagerImpl::init(void) { - bufferManager = new CellBufferManager(machineNum); - bufferManager->init(); + taskQueueImpl = new TaskQueueInfo; + taskQueueImpl->init(TASK_MAX_SIZE*4); + + taskListImpl = new CellTaskListInfo; + taskListImpl->init(machineNum*2); + + htaskImpl = new CellHTaskInfo; + htaskImpl->init(TASK_MAX_SIZE*2); speThreads = new SpeThreads(machineNum); speThreads->init(); speTaskList = new TaskListPtr[machineNum]; speTaskList_bg = new TaskListPtr[machineNum]; + for (int i = 0; i < machineNum; i++) { - speTaskList[i] = bufferManager->create_taskList(); - speTaskList_bg[i] = bufferManager->create_taskList(); + speTaskList[i] = taskListImpl->create(); + speTaskList_bg[i] = taskListImpl->create(); } flag_sendTaskList = new int[machineNum]; for (int i = 0; i < machineNum; i++) { flag_sendTaskList[i] = 1; - } - + } // PPE 側の管理をする Manager ppeManager = new FifoTaskManagerImpl(machineNum); - ppeManager->init(new PpeScheduler, bufferManager); + ppeManager->init(new PpeScheduler, this); } void @@ -54,7 +61,7 @@ { TaskQueuePtr q; - q = bufferManager->create_taskQueue(task); + q = taskQueueImpl->create(task); if (task->cpu_type == CPU_PPE) { ppeManager->append_activeTask(task); } else { @@ -118,7 +125,7 @@ list = speTaskList_bg[speid]; if (list->length >= TASK_MAX_SIZE) { - TaskListPtr newList = bufferManager->create_taskList(); + TaskListPtr newList = taskListImpl->create(); newList = TaskListInfo::append(newList, speTaskList_bg[speid]); speTaskList_bg[speid] = newList; list = newList; @@ -134,7 +141,7 @@ memcpy(task, htask, sizeof(Task)); #endif - bufferManager->free_taskQueue(d); + taskQueueImpl->free(d); } activeTaskQueue = NULL; @@ -274,7 +281,7 @@ speTaskList[id] = speTaskList_bg[id]; speTaskList_bg[id] = tmp; - bufferManager->clear_taskList(speTaskList_bg[id]); + taskListImpl->clear_taskList(speTaskList_bg[id]); speThreads->send_mail(id, 1, (unsigned int *)&speTaskList[id]); flag_sendTaskList[id] = 0;