comparison TaskManager/Cell/CellTaskManagerImpl.cc @ 956:15026ebf7a17

unified queue worked on Mac OS X
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 04 Aug 2010 17:02:26 +0900
parents 0d404f6c36a8
children 559d041313dc
comparison
equal deleted inserted replaced
955:9989dd7b9ac2 956:15026ebf7a17
2 #include "error.h" 2 #include "error.h"
3 #include <stdio.h> 3 #include <stdio.h>
4 #include <stdlib.h> 4 #include <stdlib.h>
5 #include <string.h> 5 #include <string.h>
6 #include "CellTaskManagerImpl.h" 6 #include "CellTaskManagerImpl.h"
7 #include "HTaskInfo.h" 7 #include "HTask.h"
8 #include "QueueInfo.h"
8 #include "SchedTask.h" 9 #include "SchedTask.h"
9 #include "MainScheduler.h" 10 #include "MainScheduler.h"
10 #include "types.h" 11 #include "types.h"
11 #include "SysFunc.h" 12 #include "SysFunc.h"
12 13
24 CellTaskManagerImpl::init() 25 CellTaskManagerImpl::init()
25 { 26 {
26 spe_running = 0; 27 spe_running = 0;
27 28
28 // 実行可能な HTask のリスト。 FifoTaskManager と共有される 29 // 実行可能な HTask のリスト。 FifoTaskManager と共有される
29 activeTaskQueue = new HTaskInfo(); 30 activeTaskQueue = new QueueInfo<HTask>(htaskPool);
30 // HTask の factory。 HTaskInfo ならなんでもいい。 31 // HTask の factory。 HTaskInfo ならなんでもいい。
31 htaskImpl = activeTaskQueue ; // any HTaskInfo 32 htaskImpl = activeTaskQueue ; // any HTaskInfo
32 33
33 speThreads = new SpeThreads(machineNum); 34 speThreads = new SpeThreads(machineNum);
34 speThreads->init(); 35 speThreads->init();
35 36
36 // 実行される Task 用の パイプライン用のダブルバッファ 37 // 実行される Task 用の パイプライン用のダブルバッファ
37 speTaskList = new TaskListInfoPtr[machineNum]; // spe上の走っている Task の配列 38 speTaskList = new *QueueInfo<TaskList>[machineNum]; // spe上の走っている Task の配列
38 taskListInfo = new TaskListInfoPtr[machineNum]; // 次に走る Task の配列 39 taskListInfo = new *QueueInfo<TaskList>[machineNum]; // 次に走る Task の配列
39 40
40 for (int i = 0; i < machineNum; i++) { 41 for (int i = 0; i < machineNum; i++) {
41 taskListInfo[i] = new TaskListInfo(); 42 taskListInfo[i] = new QueueInfo<TaskList>(taskListPool);
42 speTaskList[i] = new TaskListInfo(); 43 speTaskList[i] = new QueueInfo<TaskList>(taskListPool);
43 } 44 }
44 45
45 // PPE 側の管理をする Manager 46 // PPE 側の管理をする Manager
46 ppeManager = new FifoTaskManagerImpl(machineNum); 47 ppeManager = new FifoTaskManagerImpl(machineNum);
47 // 大半のTaskQueueInfoは、共有される 48 // 大半のTaskQueueInfoは、共有される