changeset 227:991f3d1ce072

fix worker
author ikkun
date Fri, 20 Jan 2017 19:12:29 +0900
parents 68c03e7057d9
children 55260ff44c8c
files src/parallel_execution/worker.c
diffstat 1 files changed, 25 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/worker.c	Tue Jan 17 18:11:39 2017 +0900
+++ b/src/parallel_execution/worker.c	Fri Jan 20 19:12:29 2017 +0900
@@ -12,18 +12,33 @@
     return (union Data*)(worker);
 }
 
-__code taskSend(struct Context* context) {
+__code taskSendWorker(struct Context* context) {
 }
 
-__code exectureWorker(struct Context* context) {
+__code taskSendWorker_stub(struct Context* context) {
+    goto taskSendWorker(context);
+}
+
+__code executeWorker(struct Context* context, Worker* worker) {
     worker->next = worker->taskReceive;
     goto meta(context, task->code);
 }
 
-__code taskReceive(struct Context* context) {
-    queue->queue = (union Data*)worker->worker->Worker.tasks;
-    queue->next = worker->execute;
-    goto meta(context, queue->queue->Queue.take);
+__code executeWorker_stub(struct Context* context) {
+    Worker* worker = &Gearef(context,Worker);
+    goto extcuteWorker(context,worker);
+}
+
+__code taskReceiveWorker(struct Context* context, Worker* worker) {
+    Queue* queue = &Gearef(context,queue);
+    queue->queue = worker->tasks;
+    queue->next = C_getTask1;
+    goto meta(context, queue->take);
+}
+
+__code taskReceiveWorker_stub(struct Context* context) {
+    Worker* worker = Gearef(context,Worker).worker;
+    goto taskReceiveWorker(context,queue);
 }
 
 __code getTask1(struct Context* context, struct Queue* queue) {
@@ -51,3 +66,7 @@
     cuMemcpyDtoHAsync();
 }
 #endif
+
+__code shutdownWorker(struct Context* context) {
+
+}