diff TaskManager/Cell/spe/TaskArray.cc @ 0:04e28d8d3c6f

first commit
author Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
date Mon, 08 Nov 2010 01:23:25 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Cell/spe/TaskArray.cc	Mon Nov 08 01:23:25 2010 +0900
@@ -0,0 +1,29 @@
+#include "Finish.h"
+#include "SysFunc.h"
+#include "Scheduler.h"
+#include "Task.h"
+
+
+SchedDefineTask(TaskArray);
+
+static Task *
+next(Task *t) 
+{
+    char *p = (char*)t;
+    p += t->size();
+    return (Task*)p;
+}
+
+static int
+run(SchedTask *s,void *rbuf, void *wbuf)
+{
+    Task *task = (Task *)rbuf;
+    Task *last = ((char*)rbuf)+ s->read_size();
+   
+    while( task <  last) {
+	task->print(s);
+	task = next(task);
+    }
+
+    return 0;
+}