annotate src/parallel_execution/origin_cs.c @ 223:8d2519c3a36e

Add input data gear example
author one
date Wed, 11 Jan 2017 17:19:53 +0900
parents bd11fa6891b6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <stdlib.h>
140
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
2 #include <stdio.h>
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include "context.h"
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 __code meta(struct Context* context, enum Code next) {
141
4f6a660c14a1 stack interface worked
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
6 // printf("meta %d\n",next);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 goto (context->code[next])(context);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 }
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 __code start_code(struct Context* context) {
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 goto meta(context, context->next);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 }
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
206
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
14 __code start_code_stub(struct Context* context) {
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
15 goto start_code(context);
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
16 }
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
17
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 __code exit_code(struct Context* context) {
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 free(context->code);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 free(context->data);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 free(context->heapStart);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 goto exit(0);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 }
206
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
24
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
25 __code exit_code_stub(struct Context* context) {
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
26 goto exit_code(context);
bd11fa6891b6 Add stub to origin_cs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 141
diff changeset
27 }