annotate TaskManager/Fifo/FifoTaskManagerImpl.cc @ 1222:d9f2e56bba86 draft

fix multicore for FifoTaskManager
author Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
date Sat, 23 Jul 2011 09:37:03 +0900
parents 26dea600d4cd
children 17508bef43be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
1 #include <stdio.h>
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
2 #include <stdlib.h>
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
3 #include <string.h>
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
4 #include "FifoTaskManagerImpl.h"
1179
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 1151
diff changeset
5 #include "CellTaskManagerImpl.h"
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
6 #include "QueueInfo.h"
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
7 #include "TaskList.h"
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
8 #include "Scheduler.h"
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
9 #include "SchedTask.h"
47
8266445bdac2 *** empty log message ***
gongo
parents: 42
diff changeset
10 #include "types.h"
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
11 #include "error.h"
690
107e6e77f482 Bulk task on going.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 674
diff changeset
12 #include "SchedNop.h"
703
0c8ad8d99656 compatibility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 690
diff changeset
13 #include "SysFunc.h"
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
14
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
15 extern QueueInfo<TaskList> *taskListPool;
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
16
1078
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
17 static void send_alloc_reply(FifoTaskManagerImpl *tm, int id, MainScheduler *s);
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
18
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
19 FifoTaskManagerImpl::~FifoTaskManagerImpl()
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
20 {
640
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
21 delete mainScheduler;
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
22
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
23 delete taskQueueImpl ;
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
24 delete htaskImpl ;
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
25
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
26 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
27
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
28 /**
853
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
29 * FifoTaskManager 単独で走るときの初期化
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
30 * MailManager は PPE スケジューラとのメール交換、
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
31 * FifoScheduler は PPE 側のスケジューラ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
32 */
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
33 void
1057
8cd123d2f3ca debug_check_spu_idle add. commandline option [-spuidle].
tkaito@henri
parents: 972
diff changeset
34 FifoTaskManagerImpl::init(int spuIdle_)
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
35 {
719
cc1b7333de92 clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
36 // TaskManager から呼ばれるので、かなりの部分は初期化されている。
cc1b7333de92 clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
37
640
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
38 mainScheduler = new MainScheduler();
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
39 mainScheduler->init(this);
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
40 mainScheduler->id = 0;
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
41 set_scheduler(mainScheduler);
42
aa11038dbdc1 *** empty log message ***
gongo
parents: 22
diff changeset
42
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
43 taskListInfo = new QueueInfo<TaskList>(taskListPool);
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
44 ppeTaskList = new QueueInfo<TaskList>(taskListPool);
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
45
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
46 schedTaskManager = new SchedTask();
835
yutaka@localhost.localdomain
parents: 833
diff changeset
47 others = 0;
972
Yutaka Kinjyo <yutaka@cr.ie.u-ryukyu.ac.jp>
parents: 955
diff changeset
48 schedTaskManager->init(0,0,0,mainScheduler,0);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
49
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
50 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
51
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
52 /**
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
53 * これは CellTaskManagerImpl から呼ばれる。
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
54 * TaskList等 は共用で使うので引数に。
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
55 * CellTaskManagerImpl と FifoTaskManagerImpl が同時に
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
56 * 上のデータにアクセスする事は(今は)ないのでこれでおk
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
57 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
58 void
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
59 FifoTaskManagerImpl::init(MainScheduler *_sched, TaskManagerImpl *tm)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
60 {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
61
640
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
62 mainScheduler = _sched;
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
63 mainScheduler->init(this);
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
64 set_scheduler(mainScheduler);
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
65
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
66 taskQueueImpl = tm-> taskQueueImpl ;
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
67 htaskImpl = tm-> htaskImpl ;
719
cc1b7333de92 clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
68 waitTaskQueue = tm->waitTaskQueue;
1077
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
69 activeTaskQueue = tm->activeTaskQueue;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
70
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
71 taskListInfo = new QueueInfo<TaskList>(taskListPool);
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
72 ppeTaskList = new QueueInfo<TaskList>(taskListPool);
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
73
936
178fbcc81fda dead lock on spu/ppu mail
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 853
diff changeset
74 // schedTaskManager = new SchedTask();
835
yutaka@localhost.localdomain
parents: 833
diff changeset
75 others = tm;
936
178fbcc81fda dead lock on spu/ppu mail
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 853
diff changeset
76 // schedTaskManager->init(0,0,0,mainScheduler);
479
bf2d2625485e Double Linked List base TaskQueue
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 475
diff changeset
77
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
78 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
79
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
80 // void FifoTaskManagerImpl::show_profile() {}
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
81 // void FifoTaskManagerImpl::start_profile() {}
672
27fec8c70c9c add profiling code
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 664
diff changeset
82
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
83 /**
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
84 * スケジューラに渡す TaskList を取得する。
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
85 *
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
86 * @return 実行タスクリスト
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
87 *
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
88 * ActiveTaskQueue (依存条件は満たし済み) のタスクを
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
89 * 実行タスクリストに入れる
1079
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
90 * CPU_PPE
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
91 */
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
92 void
1077
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
93 FifoTaskManagerImpl::set_runTaskList(QueueInfo<HTask> *activeTaskQueue)
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
94 {
499
981aa2f89a80 still fixing...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 498
diff changeset
95 // printf("active task queue length = %d\n",activeTaskQueue->length());
1077
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
96 HTaskPtr htask = activeTaskQueue->getFirst();
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
97 while (htask != NULL) {
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
98 if (htask->cpu_type == CPU_PPE) {
806
fb49e881f2ed TaslListInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 776
diff changeset
99 set_taskList(htask, taskListInfo );
1077
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
100 HTaskPtr next = activeTaskQueue->getNext(htask);
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
101 activeTaskQueue->remove(htask);
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
102 htask = next;
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
103 } else {
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
104 htask = activeTaskQueue->getNext(htask);
325b6c6d7d65 use one activeTaskQueue
yutaka@localhost.localdomain
parents: 1067
diff changeset
105 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
106 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
107 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
108
1079
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
109 /**
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
110 * exec all cpu type as simulation
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
111 */
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
112 void
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
113 FifoTaskManagerImpl::set_runTaskList1(QueueInfo<HTask> *activeTaskQueue)
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
114 {
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
115 // printf("active task queue length = %d\n",activeTaskQueue->length());
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
116 HTaskPtr htask = activeTaskQueue->getFirst();
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
117 while (htask != NULL) {
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
118 set_taskList(htask, taskListInfo );
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
119 HTaskPtr next = activeTaskQueue->getNext(htask);
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
120 activeTaskQueue->remove(htask);
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
121 htask = next;
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
122 }
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
123 }
7823233584da single cpu run on Mac OS X
one@zeus.cr.ie.u-ryukyu.ac.jp
parents: 1078
diff changeset
124
1081
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
125 /**
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
126 * called from CellTaskManagerImpl
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
127 */
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
128 void
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
129 FifoTaskManagerImpl::poll()
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
130 {
1081
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
131 set_runTaskList(activeTaskQueue);
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
132 // list を実行する
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
133 sendTaskList();
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
134 // ppe scheduler からの mail を調べる
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
135 mail_check();
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
136 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
137
1081
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
138 /**
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
139 * single CPU run
4a5498c98e34 look like working...
root@localhost.localdomain
parents: 1079
diff changeset
140 */
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
141 void
1082
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
142 FifoTaskManagerImpl::poll1()
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
143 {
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
144 set_runTaskList1(activeTaskQueue);
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
145 // list を実行する
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
146 sendTaskList();
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
147 // ppe scheduler からの mail を調べる
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
148 mail_check();
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
149 }
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
150
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
151 /**
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
152 * single CPU run
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
153 */
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
154 void
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
155 FifoTaskManagerImpl::run()
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
156 {
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
157 do {
1082
cfabe454e7cc cpu 0 never terminates
tkaito@henri
parents: 1081
diff changeset
158 poll1();
809
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 808
diff changeset
159 } while(!activeTaskQueue->empty()) ;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
160
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
161 if (!waitTaskQueue->empty()) {
736
1b225972ae88 cut printf
hiroki@localhost.localdomain
parents: 721
diff changeset
162 get_scheduler()->printf("Dead lock detected\n");
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
163 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
164 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
165
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
166 /**
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
167 * @param [list] 実行タスクリスト
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
168 * @return FifoScheduler からのメール
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
169 *
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
170 * [Tasklist] -> [番兵] -> scheduler->run を抜ける
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
171 */
647
7ba4ad4538b1 MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
172 void
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
173 FifoTaskManagerImpl::sendTaskList()
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
174 {
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
175 if (taskListInfo->empty()) return;
853
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
176 // ppeTaskList は走り終わった ppe の Task の List.
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
177 // taskListInfo はこれから走る Task の List.
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
178 // 交換して実行する
955
6ffeb543e8d4 unify all QueueInfo
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 936
diff changeset
179 QueueInfo<TaskList>* tmp = ppeTaskList;
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
180 ppeTaskList = taskListInfo;
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
181 taskListInfo = tmp;
853
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
182 // ppeTaskList は本来は循環リストなのだけど、実行中は線形リストである。
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
183 // なので、最後に 0 を代入する. 後でなおす。
809
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 808
diff changeset
184 ppeTaskList->getLast()->next = 0;
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
185 // TaskList のアドレスを送る
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
186 mainScheduler->mail_write_from_host((memaddr)ppeTaskList->getFirst());
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
187
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
188 // EXIT_COMMAND (番兵的な意味で)
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
189 // これを読むと、mainScheduler->run() から抜けて来る。
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
190 mainScheduler->mail_write_from_host((memaddr)MY_SPE_COMMAND_EXIT);
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
191
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
192 // scheduler は受け取ったメールを元に実行する
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
193 mainScheduler->run(new SchedNop());
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
194 // すべてのlistを実行するまで戻らない
853
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
195
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
196 ppeTaskList->getLast()->next = ppeTaskList;
game@zeus.cr.ie.u-ryukyu.ac.jp
parents: 835
diff changeset
197
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
198 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
199
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
200 /**
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
201 * PPE Scheduler からのメールをチェックする
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
202 *
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
203 * @param [mail_list]
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
204 * PPE 側で動く Scheduler からのメールリスト
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
205 * 終了した Task や、その他(今はまだ実装してないけど)の情報が入ってる
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
206 *
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
207 * @return Scheduler が次に実行する Task List
321
f22280772f20 merge 317
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 318
diff changeset
208 * NULL なら全てのタスクが実行終了したということ
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
209 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
210 void
719
cc1b7333de92 clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
211 FifoTaskManagerImpl::mail_check()
485
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 481
diff changeset
212 {
647
7ba4ad4538b1 MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
213 while (mainScheduler->has_mail_from_host()) {
7ba4ad4538b1 MailManager rewrite. not yet worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 644
diff changeset
214 memaddr data = mainScheduler->mail_read_from_host();
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
215
625
94d82f2c842f 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
216 if (data == (memaddr)MY_SPE_STATUS_READY) {
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
217 __debug_ppe("mail_check(): Task List finish\n");
808
3c404a32719c TaskListInfo version
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 806
diff changeset
218 ppeTaskList->freeAll();
640
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
219 } else if (data == (memaddr)MY_SPE_COMMAND_EXIT) {
ecf056ddd21a SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 638
diff changeset
220 __debug_ppe("mail_check(): Task List finish COMMAND\n");
721
a0cfe7b28882 cleanups..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 719
diff changeset
221 } else if (data == (memaddr)MY_SPE_COMMAND_MALLOC) {
1078
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
222 send_alloc_reply(this, 0, mainScheduler);
625
94d82f2c842f 64bit mode worked on Mac OS X.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 619
diff changeset
223 } else if (data != (memaddr)MY_SPE_NOP) {
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
224 __debug_ppe("mail_check(): recv from 0x%x\n", data);
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
225 // post_func を先に実行しないと、systask_finish が active_queue
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
226 // 移されてから、wait_for されるという事態が起きることがある。
830
af2fb2e641eb return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 809
diff changeset
227 #ifdef TASK_LIST_MAIL
af2fb2e641eb return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 809
diff changeset
228 TaskListPtr list = (TaskListPtr)data;
af2fb2e641eb return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 809
diff changeset
229 check_task_list_finish(schedTaskManager, list, waitTaskQueue);
af2fb2e641eb return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 809
diff changeset
230 #else
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
231 HTaskPtr task = (HTaskPtr)data;
1151
kaito@dolphins
parents: 1150
diff changeset
232 #if 0
1150
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
233 if (task->cpu_type != CPU_PPE) {
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
234 const char *name = get_task_name(task);
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
235 if (name != NULL) {
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
236 printf("[PPE] ");
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
237 printf("Task id : %d, ", task->command);
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
238 printf("Task name : %s\n", name);
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
239 }
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
240 }
d014639cbdc7 add test code.
kaito@dolphins
parents: 1147
diff changeset
241 #endif
1147
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
242 #ifndef NOT_CHECK
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
243
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
244 if (task != NULL) {
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
245 //PPE で処理された Task が返ってくるはず。
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
246 if (task->cpu_type != CPU_PPE) {
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
247 printf("attention : SPE task run on PPE\n");
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
248 printf("Task id : %d\n", task->command);
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
249 const char *name = get_task_name(task);
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
250 if (name != NULL) {
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
251 printf("Task name : %s\n", name);
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
252 }
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
253 }
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
254 }
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
255
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
256 #endif
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
257
619
278db3ca751d RenewTask removal
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 603
diff changeset
258 task->post_func(schedTaskManager, task->post_arg1, task->post_arg2);
719
cc1b7333de92 clean up scheduler main loop
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 713
diff changeset
259 check_task_finish(task, waitTaskQueue);
830
af2fb2e641eb return TaskList->self
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 809
diff changeset
260 #endif
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
261 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
262 }
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
263 }
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
264
833
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
265 void
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
266 FifoTaskManagerImpl::polling()
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
267 {
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
268 if (others!=0)
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
269 others->polling();
577bde5d0cec poling (may recurse..)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 830
diff changeset
270 }
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
271
1078
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
272 static void
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
273 send_alloc_reply(FifoTaskManagerImpl *tm, int id, MainScheduler *s)
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
274 {
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
275
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
276 /**
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
277 * info[0] = alloc_id; (CellScheduler::mainMem_alloc 参照)
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
278 * info[1] = alloc_addr;
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
279 */
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
280 memaddr alloc_info[2];
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
281 long alloc_size;
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
282 long command;
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
283
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
284 alloc_info[0] = s->mail_read_from_host();
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
285 alloc_info[1] = s->mail_read_from_host();
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
286 command = (long)alloc_info[0];
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
287 alloc_size = (long)alloc_info[1];
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
288
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
289
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
290 alloc_info[1] = (memaddr)tm->allocate(alloc_size);
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
291 //__debug_ppe("[PPE] MALLOCED 0x%lx from [SPE %d]\n", alloc_info[1],id);
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
292 // 今のところ何もしてない。どうも、この allocate を free
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
293 // するのは、SPE task が返した値を見て行うらしい。それは、
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
294 // 忘れやすいのではないか?
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
295 // s->add_output_tasklist(command, alloc_info[1], alloc_size);
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
296
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
297 s->mail_write_from_host(alloc_info[0]);
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
298 s->mail_write_from_host(alloc_info[1]);
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
299 }
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
300
6dabcd1a9ccf add MAIN MEM MALLOC
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1077
diff changeset
301
1067
5ad8fb1dc70f print_arch add.
tkaito
parents: 1057
diff changeset
302 void
5ad8fb1dc70f print_arch add.
tkaito
parents: 1057
diff changeset
303 FifoTaskManagerImpl::print_arch()
5ad8fb1dc70f print_arch add.
tkaito
parents: 1057
diff changeset
304 {
5ad8fb1dc70f print_arch add.
tkaito
parents: 1057
diff changeset
305 printf("FifoTaskManagerImpl\n");
5ad8fb1dc70f print_arch add.
tkaito
parents: 1057
diff changeset
306 }
5ad8fb1dc70f print_arch add.
tkaito
parents: 1057
diff changeset
307
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
308 /**
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
309 * # # # # # # # #
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
310 * Abstract Factory Pattern
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
311 * # # # # # # #
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
312 */
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
313 #ifdef __CERIUM_FIFO__
373
205e4a4af635 MemList not working
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 321
diff changeset
314 TaskManagerImpl*
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
315 create_impl(int num)
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
316 {
1222
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
317 #ifdef __CERIUM_PARALLEL__
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
318 //マルチコアverでコンパイルしたのにかかわらず、
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
319 //CPU数が0だと、FifoTaskManagerが呼ばれてしまうので
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
320 //0の場合は1を入れて、CellTaskManagerが呼ばれるようにする。
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
321 if (num == 0) num = 1;
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
322 #endif
d9f2e56bba86 fix multicore for FifoTaskManager
Daichi TOMA <e085740@ie.u-ryukyu.ac.jp>
parents: 1185
diff changeset
323
1179
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 1151
diff changeset
324 if (num == 0) {
1147
279b41354753 add check code.
Yutaka_Kinjyo
parents: 1082
diff changeset
325 return new FifoTaskManagerImpl(num);
1179
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 1151
diff changeset
326 } else {
1185
26dea600d4cd fix CellTaskManagerImpl
Daichi TOMA <amothic@cr.ie.u-ryukyu.ac.jp>
parents: 1179
diff changeset
327 Threads *cpus = new CpuThreads(num);
1179
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 1151
diff changeset
328 cpus->init();
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 1151
diff changeset
329 return new CellTaskManagerImpl(num,cpus);
5393bebe0956 CpuThreads update
Daichi TOMA
parents: 1151
diff changeset
330 }
3
2356238ebea7 *** empty log message ***
gongo
parents:
diff changeset
331 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents: 58
diff changeset
332 #endif // __CERIUM_FIFO__
475
4e0308d2ba73 BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 373
diff changeset
333