Mercurial > hg > Gears > GearsAgda
diff src/parallel_execution/context.h @ 90:4b5bf5b40970
put queue
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Jan 2016 06:47:35 +0900 |
parents | 9e139a340bd1 |
children | 1e074c3878c7 |
line wrap: on
line diff
--- a/src/parallel_execution/context.h Tue Jan 19 18:05:15 2016 +0900 +++ b/src/parallel_execution/context.h Tue Jan 26 06:47:35 2016 +0900 @@ -2,7 +2,7 @@ #include <pthread.h> #include "stack.h" -#define ALLOCATE_SIZE 1000 +#define ALLOCATE_SIZE 100000 enum Code { Code1, @@ -14,7 +14,7 @@ Not_find, Code6, Allocator, - Put, + PutTree, Replace, Insert, Compare, @@ -47,6 +47,14 @@ DeleteCase6, CreateWorker, TaskManager, + CreateData1, + CreateData2, + CreateTask1, + CreateTask2, + PutQueue1, + PutQueue2, + PutQueue3, + PutQueue4, Exit, }; @@ -62,7 +70,7 @@ Tree, Node, LoopCounter, - WaitQueue, + Element, ActiveQueue, }; @@ -78,9 +86,8 @@ stack_ptr node_stack; int dataNum; union Data **data; - struct Queue* waitQueue; struct Queue* activeQueue; - struct Tree* Tree; + struct Tree* tree; }; union Data { @@ -88,20 +95,26 @@ int i; } loopCounter; struct Worker { - //enum DataType type; int num; struct Context* contexts; } worker; + struct Task { + enum Code code; + int key; + } task; + struct Queue { + struct Element* first; + struct Element* last; + int count; + } queue; + struct Element { + struct Task* task; + struct Element* next; + } element; struct Array { - //enum DataType type; - int size; + int index; int* array; } array; - struct Spots { - //enum DataType type; - int x; - int y; - } spot; struct Tree { enum Code next; struct Node* root; @@ -112,7 +125,7 @@ // need to tree enum Code next; int key; // comparable data segment - int value; + union Data* value; struct Node* left; struct Node* right; // need to balancing