changeset 1878:11c70b35a83f draft

dead lock on pipeline and ppe_waiter
author kono
date Tue, 31 Dec 2013 20:04:31 +0900
parents f73ca57cdc81
children ab37578f03c3
files TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Cell/CellTaskManagerImpl.h
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc	Tue Dec 31 19:33:26 2013 +0900
+++ b/TaskManager/Cell/CellTaskManagerImpl.cc	Tue Dec 31 20:04:31 2013 +0900
@@ -21,14 +21,14 @@
     delete speThreads;
     delete[] speTaskList;
     delete ppeManager;
-    delete recive_wait;
+    if (receive_wait) delete receive_wait;
 }
 
 void CellTaskManagerImpl::init(int spuIdle_,int useRefDma,int export_task_log) {
     spe_running = 0;
     spuIdle = spuIdle_;
     int m = machineNum == 0?1:machineNum; // at least 1 tasklistinfo in -cpu 0
-    recive_wait = new Sem(0);
+    receive_wait = 0; // new Sem(0);
 
     // 実行される Task 用の パイプライン用のダブルバッファ
     speTaskList = new QueueInfo<TaskList>*[m]; // spe上の走っている Task の配列
@@ -66,7 +66,7 @@
 
     _export_task_log = export_task_log;
 
-    speThreads->set_mail_waiter(recive_wait);
+    speThreads->set_mail_waiter(receive_wait);
 }
 
 void CellTaskManagerImpl::append_activeTask(HTaskPtr task) {
@@ -158,7 +158,7 @@
 void CellTaskManagerImpl::sendTaskList() {
     for (int id = 0; id < machineNum; id++) {
         mail_check(id);
-        if (speTaskList[id]->empty()) {
+        if ((! taskListInfo[id]->empty()) && speTaskList[id]->empty()) {
             // SPE に送る TaskList の準備
             send_taskList(id);
         }
@@ -198,9 +198,9 @@
         // SPE side
         for (;;) {
             poll();
-            if (ppeManager->activeTaskQueue->empty() && spe_running > 0)
-	        recive_wait->sem_p();
-	    else
+            if (ppeManager->activeTaskQueue->empty() && spe_running > 0) {
+	        if (receive_wait) receive_wait->sem_p();
+	    } else
                 break;
         }
 
--- a/TaskManager/Cell/CellTaskManagerImpl.h	Tue Dec 31 19:33:26 2013 +0900
+++ b/TaskManager/Cell/CellTaskManagerImpl.h	Tue Dec 31 20:04:31 2013 +0900
@@ -21,7 +21,7 @@
     /* variables */
     int cpu_num;
     int id_offset;
-    SemPtr recive_wait;  //semaphore to wait any message from spe
+    SemPtr receive_wait;  //semaphore to wait any message from spe
 
     QueueInfo<TaskList> **taskListInfo;
     QueueInfo<TaskList> **speTaskList;  // running task