changeset 1880:a865ba7acb08 draft

free_ TaskList breaks next. Use it before free_.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 02 Jan 2014 21:46:22 +0900
parents ab37578f03c3
children 392c1a2d699d
files TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/HTask.h
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc	Thu Jan 02 00:39:41 2014 +0900
+++ b/TaskManager/Cell/CellTaskManagerImpl.cc	Thu Jan 02 21:46:22 2014 +0900
@@ -158,7 +158,10 @@
 void CellTaskManagerImpl::sendTaskList() {
     for (int id = 0; id < machineNum; id++) {
         mail_check(id);
-        if ((! taskListInfo[id]->empty()) && speTaskList[id]->empty()) {
+        if (!speTaskList[id]->empty()) {
+            continue; // まだ、走ってる
+        }
+        if (!taskListInfo[id]->empty()) {
             send_taskList(id);
         }
     }
@@ -203,7 +206,6 @@
 	    } else
                 break;
         }
-
         if (spe_running < spu_limit) {
             debug_check_spe_idle(ppeManager->activeTaskQueue, spe_running);
         }
@@ -282,15 +284,15 @@
                 check_task_list_finish(schedTaskManager, list, waitTaskQueue);
             if (speTaskList[id]->getFirst() == list) {
                 speTaskList[id]->next = list->next;
-                speTaskList[id]->free_(list);
                 if (! list->next)   // make it normal empty cyclic list
                     speTaskList[id]->next = speTaskList[id];
+                speTaskList[id]->free_(list);
             }
             if (taskListInfo[id]->getFirst() == list) {
                 taskListInfo[id]->next = list->next;
-                taskListInfo[id]->free_(list);
                 if (! list->next)   // make it normal empty cyclic list
                     taskListInfo[id]->next = taskListInfo[id];
+                taskListInfo[id]->free_(list);
             }
 #else
             // 終了したタスク(PPEにあるのでアドレス)
--- a/TaskManager/kernel/ppe/HTask.cc	Thu Jan 02 00:39:41 2014 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Thu Jan 02 21:46:22 2014 +0900
@@ -227,5 +227,10 @@
     return count;
 }
 
+void 
+HTask::print() {
+    ((TaskList *)rbuf)->print();
+}
+
 
 /* end */
--- a/TaskManager/kernel/ppe/HTask.h	Thu Jan 02 00:39:41 2014 +0900
+++ b/TaskManager/kernel/ppe/HTask.h	Thu Jan 02 21:46:22 2014 +0900
@@ -87,6 +87,7 @@
         delete wait_me;
         delete wait_i;
     }
+    void print() ;
 
  private: