Mercurial > hg > Members > kono > Cerium
changeset 832:29094b48d966
poling (may recurse..)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 25 May 2010 18:22:59 +0900 |
parents | 65e9eab53f50 |
children | bbb0021ff5ce |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/CellTaskManagerImpl.h TaskManager/ChangeLog TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.h TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTask.h |
diffstat | 9 files changed, 34 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Tue May 25 18:22:59 2010 +0900 @@ -41,7 +41,7 @@ } // PPE 側の管理をする Manager - ppeManager = new FifoTaskManagerImpl(machineNum); + ppeManager = new FifoTaskManagerImpl(machineNum, this); // 大半のTaskQueueInfoは、共有される MainScheduler *mscheduler = new MainScheduler; ppeManager->init(mscheduler, this); @@ -176,6 +176,14 @@ } } +void +CellTaskManagerImpl::polling() +{ + // may call recursively check_task_list_finish() + // we need fifo here + mail_check(); +} + static void send_alloc_reply(CellTaskManagerImpl *tm, int id, SpeThreads *speThreads) { @@ -245,6 +253,6 @@ TaskManagerImpl* create_impl(int num) { - return new CellTaskManagerImpl(num); + return new CellTaskManagerImpl(num,0); } #endif // __CERIUM_CELL
--- a/TaskManager/Cell/CellTaskManagerImpl.h Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.h Tue May 25 18:22:59 2010 +0900 @@ -30,6 +30,7 @@ void append_activeTask(HTaskPtr); void show_profile() ; void start_profile() ; + void polling(); private: void send_taskList(int id);
--- a/TaskManager/ChangeLog Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/ChangeLog Tue May 25 18:22:59 2010 +0900 @@ -4,6 +4,9 @@ のが望ましい。読んで、とりあえずfifoに入れておく。その場で処理しても良いが、 check_task_list_finishとかが再帰的に呼びされるのがやっかい。 + Task 実行ループは Scheduler にpoling routineを登録するのが良さそう。 + post_func は、SchedTask 経由で poling すれば良い。 + 2010-5-22 Shinji KONO <kono@ie.u-ryukyu.ac.jp> CpuThread を作るなら、create_task は、manager にメールで教えないとだめ。
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Tue May 25 18:22:59 2010 +0900 @@ -180,7 +180,12 @@ } } - +void +FifoTaskManagerImpl::polling() +{ + if (others!=0) + others->polling(); +} /** * # # # # # # # #
--- a/TaskManager/Fifo/FifoTaskManagerImpl.h Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.h Tue May 25 18:22:59 2010 +0900 @@ -27,6 +27,7 @@ void run(); void show_profile() {}; void start_profile() {}; + void polling(); void mail_check();
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc Tue May 25 18:22:59 2010 +0900 @@ -17,8 +17,8 @@ { } -TaskManagerImpl::TaskManagerImpl(int num) - : machineNum(num) { +TaskManagerImpl::TaskManagerImpl(int num, TaskManagerImpl* o) + : machineNum(num), others(o) { activeTaskQueue = new HTaskInfo(); waitTaskQueue = new HTaskInfo(); htaskImpl = waitTaskQueue ; // any HTaskInfo @@ -187,6 +187,7 @@ // assert(next<list->length); i+=next; } + s->polling(); check_task_finish(me, wait_queue); } }
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/kernel/ppe/TaskManagerImpl.h Tue May 25 18:22:59 2010 +0900 @@ -23,9 +23,10 @@ SchedTask *schedTaskManager; Scheduler *scheduler; + TaskManagerImpl *others; /* constructor */ - TaskManagerImpl(int num = 1) ; + TaskManagerImpl(int num = 1, TaskManagerImpl *others = 0) ; virtual ~TaskManagerImpl() { } @@ -37,6 +38,7 @@ virtual void show_profile() = 0; virtual void append_activeTask(HTaskPtr); virtual void append_waitTask(HTaskPtr); + virtual void polling() = 0; void check_task_finish(HTaskPtr task, HTaskInfo *wait_queue); void check_task_list_finish(SchedTask *s, TaskListPtr list, HTaskInfo *wait_queue);
--- a/TaskManager/kernel/schedule/SchedTask.cc Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Tue May 25 18:22:59 2010 +0900 @@ -297,6 +297,11 @@ return manager->allocate(size,align) ; } +void SchedTask::polling() +{ + manager->polling(); +} + Scheduler* SchedTask::get_scheduler() { return scheduler;
--- a/TaskManager/kernel/schedule/SchedTask.h Tue May 25 17:48:39 2010 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.h Tue May 25 18:22:59 2010 +0900 @@ -71,6 +71,8 @@ void *allocate(int size); void free_(void *p) ; + void polling(); + /* これは禁止するべき */ void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask); void dma_store(void *buf,memaddr addr, uint32 size, uint32 mask);