Mercurial > hg > Members > Moririn
changeset 183:dec50dd624c7
fix
author | mir3636 |
---|---|
date | Thu, 15 Dec 2016 17:31:38 +0900 |
parents | 57a11c15ff4c |
children | 21840c7fb309 |
files | src/parallel_execution/context.h src/parallel_execution/twice.c src/parallel_execution/worker.c |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/context.h Wed Dec 14 21:33:11 2016 +0900 +++ b/src/parallel_execution/context.h Thu Dec 15 17:31:38 2016 +0900 @@ -180,7 +180,6 @@ struct TaskManager { int numWorker; enum Code spawn; - enum Code taskSend; enum Code shutdown; struct Worker* workers; } taskManager;
--- a/src/parallel_execution/twice.c Wed Dec 14 21:33:11 2016 +0900 +++ b/src/parallel_execution/twice.c Thu Dec 15 17:31:38 2016 +0900 @@ -3,6 +3,10 @@ #include "context.h" #include "origin_cs.h" +struct LoopCounter { + int i; +} loopCounter; + __code twice(struct Context* context, struct LoopCounter* loopCounter, int index, int prefix, int* array) { int i = loopCounter->i;
--- a/src/parallel_execution/worker.c Wed Dec 14 21:33:11 2016 +0900 +++ b/src/parallel_execution/worker.c Thu Dec 15 17:31:38 2016 +0900 @@ -3,6 +3,16 @@ #include "context.h" #include "origin_cs.h" +union Data* createWorker(struct Context* context) { + struct Worker* worker = &ALLOCATE(context, Worker)->Worker; + struct Queue* tasks = &ALLOCATE(context, Queue)->Queue; + worker->execute = C_executeWorker; + worker->taskSend = C_taskSendWorker; + worker->taskRecive = C_taskReciveWorker; + worker->shutdown = C_shutdownWorker; + return (union Data*)(worker); +} + __code getTask1(struct Context* context, struct Queue* queue) { queue->next = C_getTask2; goto meta(context, queue->take);