# HG changeset patch # User Shinji KONO # Date 1280908946 -32400 # Node ID 15026ebf7a174023c858f20addeeeab29a3db198 # Parent 9989dd7b9ac23e20679520b2f0bed1d56c6eb29d unified queue worked on Mac OS X diff -r 9989dd7b9ac2 -r 15026ebf7a17 TaskManager/Cell/CellTaskManagerImpl.cc --- a/TaskManager/Cell/CellTaskManagerImpl.cc Wed Aug 04 16:46:25 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Wed Aug 04 17:02:26 2010 +0900 @@ -4,7 +4,8 @@ #include #include #include "CellTaskManagerImpl.h" -#include "HTaskInfo.h" +#include "HTask.h" +#include "QueueInfo.h" #include "SchedTask.h" #include "MainScheduler.h" #include "types.h" @@ -26,7 +27,7 @@ spe_running = 0; // 実行可能な HTask のリスト。 FifoTaskManager と共有される - activeTaskQueue = new HTaskInfo(); + activeTaskQueue = new QueueInfo(htaskPool); // HTask の factory。 HTaskInfo ならなんでもいい。 htaskImpl = activeTaskQueue ; // any HTaskInfo @@ -34,12 +35,12 @@ speThreads->init(); // 実行される Task 用の パイプライン用のダブルバッファ - speTaskList = new TaskListInfoPtr[machineNum]; // spe上の走っている Task の配列 - taskListInfo = new TaskListInfoPtr[machineNum]; // 次に走る Task の配列 + speTaskList = new *QueueInfo[machineNum]; // spe上の走っている Task の配列 + taskListInfo = new *QueueInfo[machineNum]; // 次に走る Task の配列 for (int i = 0; i < machineNum; i++) { - taskListInfo[i] = new TaskListInfo(); - speTaskList[i] = new TaskListInfo(); + taskListInfo[i] = new QueueInfo(taskListPool); + speTaskList[i] = new QueueInfo(taskListPool); } // PPE 側の管理をする Manager diff -r 9989dd7b9ac2 -r 15026ebf7a17 TaskManager/kernel/ppe/HTask.h --- a/TaskManager/kernel/ppe/HTask.h Wed Aug 04 16:46:25 2010 +0900 +++ b/TaskManager/kernel/ppe/HTask.h Wed Aug 04 17:02:26 2010 +0900 @@ -13,6 +13,8 @@ typedef void (*PostFunction)(SchedTask *s, void *read, void *write); +extern QueueInfo* taskQueuePool; + /*! @class @@ -61,6 +63,11 @@ return this; } + void initOnce() { + wait_me = new QueueInfo(taskQueuePool); + wait_i = new QueueInfo(taskQueuePool); + } + private: int param_index; diff -r 9989dd7b9ac2 -r 15026ebf7a17 TaskManager/kernel/ppe/QueueInfo.h --- a/TaskManager/kernel/ppe/QueueInfo.h Wed Aug 04 16:46:25 2010 +0900 +++ b/TaskManager/kernel/ppe/QueueInfo.h Wed Aug 04 17:02:26 2010 +0900 @@ -111,6 +111,7 @@ T* p = q; for (; num-- > 0;) { p->waiter = NULL; + p->initOnce(); queuePool->addLast(p); p = (T*)ROUND_UP_ALIGN((long)(p+1),DEFAULT_ALIGNMENT); } diff -r 9989dd7b9ac2 -r 15026ebf7a17 TaskManager/kernel/ppe/TaskList.h --- a/TaskManager/kernel/ppe/TaskList.h Wed Aug 04 16:46:25 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskList.h Wed Aug 04 17:02:26 2010 +0900 @@ -19,6 +19,7 @@ SimpleTask tasks[TASK_MAX_SIZE]; // 32*TASK_MAX_SIZE void init() { length = 0; waiter=this; } + void initOnce() { } } ; typedef TaskList* TaskListPtr; diff -r 9989dd7b9ac2 -r 15026ebf7a17 TaskManager/kernel/ppe/TaskQueue.h --- a/TaskManager/kernel/ppe/TaskQueue.h Wed Aug 04 16:46:25 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskQueue.h Wed Aug 04 17:02:26 2010 +0900 @@ -23,6 +23,7 @@ TaskQueue *prev; void init() { } + void initOnce() { } TaskQueue *init(HTask *task) { this->task = task;