# HG changeset patch # User Shinji KONO # Date 1274779379 -32400 # Node ID 577bde5d0cec13c272aa24b8a6e9edc963310281 # Parent b3c004fe6bc3a9283045b3fe94261476745555c1 poling (may recurse..) diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/Cell/CellTaskManagerImpl.cc --- 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 diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/Cell/CellTaskManagerImpl.h --- 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); diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/ChangeLog --- 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 CpuThread を作るなら、create_task は、manager にメールで教えないとだめ。 diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/Fifo/FifoTaskManagerImpl.cc --- 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(); +} /** * # # # # # # # # diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/Fifo/FifoTaskManagerImpl.h --- 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(); diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/kernel/ppe/TaskManagerImpl.cc --- 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(nextlength); i+=next; } + s->polling(); check_task_finish(me, wait_queue); } } diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/kernel/ppe/TaskManagerImpl.h --- 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); diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/kernel/schedule/SchedTask.cc --- 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; diff -r b3c004fe6bc3 -r 577bde5d0cec TaskManager/kernel/schedule/SchedTask.h --- 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);