changeset 1424:0ce6c6880b4b draft

change to the queue form the list.
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Sun, 11 Mar 2012 16:36:20 +0900
parents 515a0f15b5d2
children 8bd889db45a1
files TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/TaskLog.h TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h
diffstat 4 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc	Fri Mar 09 19:03:18 2012 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Sun Mar 11 16:36:20 2012 +0900
@@ -37,7 +37,7 @@
     waitTask *wait_task = new waitTask;
     wait_task->task_id = master->tasklog->mtask_id;
     wait_task->cmd = master->command;
-    tasklog->wait_for_list.push_back(wait_task);
+    tasklog->wait_for_list.addLast(wait_task);
 
     mimpl->set_task_depend(master, this);
 }
--- a/TaskManager/kernel/ppe/TaskLog.h	Fri Mar 09 19:03:18 2012 +0900
+++ b/TaskManager/kernel/ppe/TaskLog.h	Sun Mar 11 16:36:20 2012 +0900
@@ -1,12 +1,16 @@
 #ifndef INCLUDED_TASKLOG
 #define INCLUDED_TASKLOG
 
-#include <list>
 #include "HTask.h"
+#include "QueueInfo.h"
 
 struct waitTask {
     int task_id;
     int cmd;
+
+    waitTask *next;
+    waitTask *prev;
+    waitTask *waiter;
 };
 
 class TaskLog {
@@ -15,11 +19,15 @@
     /* variables */
     int mtask_id;
     int cmd;
-    std::list<waitTask*> wait_for_list;
+    QueueInfo<waitTask> wait_for_list;
     unsigned long long create_time;
     unsigned long long execute_time;
     unsigned long long finish_time;
 
+    TaskLog *next;
+    TaskLog *prev;
+    TaskLog *waiter;
+
     /* constructor */
     TaskLog() {
         mtask_id = task_id;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc	Fri Mar 09 19:03:18 2012 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc	Sun Mar 11 16:36:20 2012 +0900
@@ -8,7 +8,6 @@
 #include "SysFunc.h"
 #include "rdtsc.h"
 #include <string.h>
-#include <list>
 
 // singleton
 QueueInfo<TaskQueue> *taskQueuePool = new QueueInfo<TaskQueue>() ;
@@ -70,7 +69,7 @@
     new_task->from = (memaddr)from;
 
     TaskLog *tasklog = new TaskLog();
-    taskLogQueue.push_back(tasklog);
+    taskLogQueue.addLast(tasklog);
     new_task->tasklog = tasklog;
 
 #ifdef EARLY_TOUCH
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h	Fri Mar 09 19:03:18 2012 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.h	Sun Mar 11 16:36:20 2012 +0900
@@ -27,7 +27,7 @@
     QueueInfo<TaskQueue> *taskQueueImpl;
     QueueInfo<HTask> *htaskImpl;
 
-    std::list<TaskLog*> taskLogQueue;
+    QueueInfo<TaskLog> taskLogQueue;
 
     SchedTask *schedTaskManager;
     Scheduler *scheduler;