changeset 176:f0427e27dd7b

create interface of Task, TaskManager, Worker
author mir3636
date Mon, 28 Nov 2016 18:06:50 +0900
parents 00107b452a04
children bb52f7f77bf5
files src/parallel_execution/context.h
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/context.h	Mon Nov 28 17:49:08 2016 +0900
+++ b/src/parallel_execution/context.h	Mon Nov 28 18:06:50 2016 +0900
@@ -161,6 +161,7 @@
 union Data {
     struct Meta {
         enum DataType type;
+        struct Queue* wait; // tasks waiting this dataGear
     } meta;
     struct Time {
         enum Code next;
@@ -170,9 +171,20 @@
         int i;
         struct Tree* tree;
     } loopCounter;
+    struct TaskManager {
+        int numWorker;
+        enum Code spawn;
+        enum Code shutdown;
+        struct Worker* workers;
+    }
     struct Worker {
-        int num;
+        int id;
         struct Context* contexts;
+        enum Code execute;
+        enum Code taskSend;
+        enum Code taskRecive;
+        enum Code shutdown;
+        struct Queue* tasks;
     } worker;
 #ifdef USE_CUDA
     struct CudaTask {
@@ -185,9 +197,7 @@
 #endif
     struct Task {
         enum Code code;
-        int key;
-        struct Queue* waitMe;
-        struct Queue* waitI;
+        struct Queue* dataGears;
         int idsCount;
     } Task;
     // Queue Interface