# HG changeset patch # User Shinji KONO # Date 1254624466 -32400 # Node ID 926d6aff886cd10702a141f0725c0399e5a8304e # Parent e083c4ff91c1352a1eee7f56f7a33e363ff6e8a7 CellBufferManager removed diff -r e083c4ff91c1 -r 926d6aff886c TaskManager/Cell/CellBufferManager.cc --- 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); -} diff -r e083c4ff91c1 -r 926d6aff886c TaskManager/Cell/CellBufferManager.h --- 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 diff -r e083c4ff91c1 -r 926d6aff886c TaskManager/Cell/CellTaskManagerImpl.cc --- 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 #include #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;