# HG changeset patch # User mir3636 # Date 1480324010 -32400 # Node ID f0427e27dd7b61519688dbb5f1ab23744c115e3d # Parent 00107b452a04f2ab2e1bb3a6aaf322843b8215df create interface of Task, TaskManager, Worker diff -r 00107b452a04 -r f0427e27dd7b src/parallel_execution/context.h --- 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