Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/TaskManagerImpl.h @ 634:62e570ac5db2 draft
SimpleTask start
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Nov 2009 17:29:14 +0900 |
parents | 278db3ca751d |
children | aba1600e8f83 |
rev | line source |
---|---|
3 | 1 #ifndef INCLUDED_TASK_MANAGER_IMPL |
2 #define INCLUDED_TASK_MANAGER_IMPL | |
3 | |
307 | 4 #include "MailManager.h" |
5 #include "ListData.h" | |
475
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
6 #include "TaskListInfo.h" |
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
7 #include "TaskQueueInfo.h" |
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
8 #include "HTaskInfo.h" |
619 | 9 class Scheduler; |
10 class MemList; | |
475
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
11 |
54 | 12 |
3 | 13 class TaskManagerImpl { |
14 public: | |
15 | |
16 /* variables */ | |
17 int machineNum; | |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
496
diff
changeset
|
18 HTaskInfo *activeTaskQueue; |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
496
diff
changeset
|
19 HTaskInfo *waitTaskQueue; |
475
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
20 |
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
21 TaskListInfo *taskListImpl; |
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
22 TaskQueueInfo *taskQueueImpl; |
4e0308d2ba73
BufferManager removed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
373
diff
changeset
|
23 HTaskInfo *htaskImpl; |
619 | 24 |
546 | 25 SchedTask *schedTaskManager; |
3 | 26 |
480
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
27 /* constructor */ |
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
28 TaskManagerImpl(int num = 1) ; |
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
29 |
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
30 virtual ~TaskManagerImpl() { } |
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
31 |
3 | 32 /* functions */ |
109 | 33 // system |
480
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
34 virtual void init() = 0; |
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
35 virtual void run() = 0; |
498
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
496
diff
changeset
|
36 virtual void append_activeTask(HTaskPtr); |
bce667ff20b9
double linked HTaskInfo/HTask
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
496
diff
changeset
|
37 virtual void append_waitTask(HTaskPtr); |
109 | 38 |
39 void check_task_finish(HTaskPtr task); | |
480
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
40 void wakeup_waitTask(); |
109 | 41 |
480
75e4afa40da2
TaskQueueInfo initiaization...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
479
diff
changeset
|
42 void systask_init(); |
109 | 43 |
44 // user | |
45 HTaskPtr create_task(int cmd); | |
634 | 46 HTaskPtr create_task(int cmd, void *rbuf, long r_size, void *rbuf, long w_size); |
567 | 47 void set_task_depend(HTaskPtr master, HTaskPtr slave); |
48 void spawn_task(HTaskPtr); | |
65 | 49 void set_task_cpu(HTaskPtr, CPU_TYPE); |
619 | 50 |
109 | 51 virtual void* allocate(int size) = 0; |
538 | 52 virtual void* allocate(int size,int align) = 0; |
373 | 53 virtual Scheduler* get_scheduler() = 0; |
3 | 54 }; |
619 | 55 |
3 | 56 #endif |