comparison src/parallel_execution/CPUWorker.cbc @ 372:d6ce4273e7d1

Add dimension task spawn
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Tue, 11 Jul 2017 17:47:11 +0900
parents 534601ed8c50
children fb50cf8aa615
comparison
equal deleted inserted replaced
371:c3a7a086e82a 372:d6ce4273e7d1
86 goto odgCommit2(context, 86 goto odgCommit2(context,
87 Gearef(context, Queue)); 87 Gearef(context, Queue));
88 } 88 }
89 89
90 __code odgCommit3(struct TaskManager* taskManager, struct Context* task) { 90 __code odgCommit3(struct TaskManager* taskManager, struct Context* task) {
91 if(__sync_fetch_and_sub(&task->idgCount, 1)) { 91 int idgCount = task->idgCount;
92 if(task->idgCount == 0) { 92 if(__sync_bool_compare_and_swap(&task->idgCount, idgCount, idgCount-1)) { // atomic decrement idg counter
93 if(idgCount-1 == 0) {
93 taskManager->taskManager = (union Data*)task->taskManager; 94 taskManager->taskManager = (union Data*)task->taskManager;
94 taskManager->context = task; 95 taskManager->context = task;
95 taskManager->next = C_odgCommit1; 96 taskManager->next = C_odgCommit1;
96 goto meta(context, task->taskManager->spawn); 97 goto meta(context, task->taskManager->spawn);
97 } else { 98 } else {