annotate src/parallel_execution/context.c @ 144:d529c024e5a5

name fixes
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 10 Nov 2016 07:33:10 +0900
parents f31b4e4bf4bb
children cc071cf1ba85
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>
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include "context.h"
132
7c309e1aea73 Code Gears stack api
one
parents: 131
diff changeset
4 #include "stack.h"
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 extern __code code1_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 extern __code code2_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 extern __code code3_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 extern __code code4(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 extern __code code5(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 extern __code find(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 extern __code not_find(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 extern __code code6(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 extern __code meta(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 extern __code put_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 extern __code replaceNode_stub(struct Context*);
124
36ac17d37be4 Fix compile error but not work
one
parents: 114
diff changeset
17 extern __code replaceNode1_stub(struct Context*);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 extern __code insertNode_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 extern __code rotateLeft_stub(struct Context*);
140
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 136
diff changeset
20 extern __code rotateLeft1_stub(struct Context*);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 extern __code rotateRight_stub(struct Context*);
140
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 136
diff changeset
22 extern __code rotateRight1_stub(struct Context*);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 extern __code colorFlip_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 extern __code fixUp_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 extern __code changeReference_stub(struct Context*);
144
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
26 extern __code insertCase1_stub(struct Context*);
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
27 extern __code insertCase2_stub(struct Context*);
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
28 extern __code insertCase3_stub(struct Context*);
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
29 extern __code insertCase4_stub(struct Context*);
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
30 extern __code insertCase5_stub(struct Context*);
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
31 extern __code insertCase51_stub(struct Context*);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 extern __code stackClear_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 extern __code get_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 extern __code search_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 extern __code delete_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 extern __code delete1_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 extern __code delete2_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 extern __code delete3_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 extern __code replaceNodeForDelete1_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 extern __code replaceNodeForDelete2_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 extern __code findMax1_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 extern __code findMax2_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 extern __code deleteCase1_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 extern __code deleteCase2_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 extern __code deleteCase3_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 extern __code deleteCase4_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 extern __code deleteCase5_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 extern __code deleteCase6_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 extern __code createWorker_stub(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 extern __code taskManager_stub(struct Context*);
90
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
51 extern __code createData1_stub(struct Context*);
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
52 extern __code createData2_stub(struct Context*);
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
53 extern __code createTask1_stub(struct Context*);
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
54 extern __code createTask2_stub(struct Context*);
112
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
55 extern __code createTask3_stub(struct Context*);
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
56 extern __code createTask4_stub(struct Context*);
90
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
57 extern __code putQueue1_stub(struct Context*);
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
58 extern __code putQueue2_stub(struct Context*);
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
59 extern __code putQueue3_stub(struct Context*);
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
60 extern __code putQueue4_stub(struct Context*);
91
1e074c3878c7 modify tree
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
61 extern __code getQueue_stub(struct Context*);
131
a4507906938c Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 130
diff changeset
62 extern __code pushSingleLinkedStack_stub(struct Context*);
a4507906938c Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 130
diff changeset
63 extern __code popSingleLinkedStack_stub(struct Context*);
112
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
64 extern __code spawnTask_stub(struct Context*);
92
851da1107223 implement twice
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
65 extern __code twice_stub(struct Context*);
95
3e28ee215c0e modify twice, use OSAtomiceCompareAndSwap
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 92
diff changeset
66 extern __code start_time_stub(struct Context*);
3e28ee215c0e modify twice, use OSAtomiceCompareAndSwap
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 92
diff changeset
67 extern __code end_time_stub(struct Context*);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 extern __code exit_code(struct Context*);
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 __code initContext(struct Context* context) {
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE;
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
72 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*);
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
73 context->data = NEWN(ALLOCATE_SIZE, union Data*);
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
74 context->heapStart = NEWN(context->heapLimit, char);
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
75 context->heap = context->heapStart;
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 context->codeNum = Exit;
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
144
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
79 context->code[C_code1] = code1_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
80 context->code[C_code2] = code2_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
81 context->code[C_put] = put_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
82 context->code[C_replaceNode] = replaceNode_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
83 context->code[C_replaceNode1] = replaceNode1_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
84 context->code[C_insertNode] = insertNode_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
85 context->code[C_rotateLeft] = rotateLeft_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
86 context->code[C_rotateLeft1] = rotateLeft1_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
87 context->code[C_rotateRight] = rotateRight_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
88 context->code[C_rotateRight1] = rotateRight1_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
89 context->code[C_insertCase1] = insertCase1_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
90 context->code[C_insertCase2] = insertCase2_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
91 context->code[C_insertCase3] = insertCase3_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
92 context->code[C_insertCase4] = insertCase4_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
93 context->code[C_insertCase5] = insertCase5_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
94 context->code[C_insertCase51] = insertCase51_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
95 context->code[C_stackClear] = stackClear_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
96 context->code[C_get] = get_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
97 context->code[C_search] = search_stub;
140
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 136
diff changeset
98
144
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
99 context->code[C_pushSingleLinkedStack] = pushSingleLinkedStack_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
100 context->code[C_popSingleLinkedStack] = popSingleLinkedStack_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
101 context->code[C_pop2SingleLinkedStack] = pop2SingleLinkedStack_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
102 context->code[C_getSingleLinkedStack] = getSingleLinkedStack_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
103 context->code[C_get2SingleLinkedStack] = get2SingleLinkedStack_stub;
d529c024e5a5 name fixes
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 140
diff changeset
104 context->code[C_isEmptySingleLinkedStack] = isEmptySingleLinkedStack_stub;
140
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 136
diff changeset
105
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 /* context->code[Delete] = delete_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 /* context->code[Delete1] = delete1_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 /* context->code[Delete2] = delete2_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 /* context->code[Delete3] = delete3_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 /* context->code[Replace_d1] = replaceNodeForDelete1_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 /* context->code[Replace_d2] = replaceNodeForDelete2_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 /* context->code[FindMax1] = findMax1_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 /* context->code[FindMax2] = findMax2_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 /* context->code[DeleteCase1] = deleteCase1_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 /* context->code[DeleteCase2] = deleteCase2_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 /* context->code[DeleteCase3] = deleteCase3_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 /* context->code[DeleteCase4] = deleteCase4_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 /* context->code[DeleteCase5] = deleteCase5_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 /* context->code[DeleteCase6] = deleteCase6_stub; */
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 context->code[CreateWorker] = createWorker_stub;
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 context->code[TaskManager] = taskManager_stub;
90
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
122 context->code[CreateData1] = createData1_stub;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
123 context->code[CreateData2] = createData2_stub;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
124 context->code[CreateTask1] = createTask1_stub;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
125 context->code[CreateTask2] = createTask2_stub;
112
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
126 context->code[CreateTask3] = createTask3_stub;
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
127 context->code[CreateTask4] = createTask4_stub;
90
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
128 context->code[PutQueue1] = putQueue1_stub;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
129 context->code[PutQueue2] = putQueue2_stub;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
130 context->code[PutQueue3] = putQueue3_stub;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
131 context->code[PutQueue4] = putQueue4_stub;
91
1e074c3878c7 modify tree
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 90
diff changeset
132 context->code[GetQueue] = getQueue_stub;
112
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
133 context->code[SpawnTask] = spawnTask_stub;
92
851da1107223 implement twice
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
134 context->code[Twice] = twice_stub;
95
3e28ee215c0e modify twice, use OSAtomiceCompareAndSwap
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 92
diff changeset
135 context->code[StartTime] = start_time_stub;
112
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
136 context->code[EndTime] = end_time_stub;
e3cba827d489 Add spawnTask CS
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 109
diff changeset
137 context->code[Exit] = exit_code;
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
139 struct Worker* worker = ALLOC_DATA(context, Worker);
87
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
140 worker->num = 0;
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
141 worker->contexts = 0;
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
142
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
143 struct Allocate* allocate = ALLOC_DATA(context, Allocate);
87
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
144 allocate->size = 0;
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
145
131
a4507906938c Fix compile error but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 130
diff changeset
146
132
7c309e1aea73 Code Gears stack api
one
parents: 131
diff changeset
147 ALLOC_DATA(context, Stack);
130
2bb5e4f0fd35 Stackinterface
ikkun
parents: 124
diff changeset
148
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
149 struct Tree* tree = ALLOC_DATA(context, Tree);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 tree->root = 0;
87
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
151
124
36ac17d37be4 Fix compile error but not work
one
parents: 114
diff changeset
152 struct Traverse* traverse = ALLOC_DATA(context, Traverse);
132
7c309e1aea73 Code Gears stack api
one
parents: 131
diff changeset
153 traverse->nodeStack = &createSingleLinkedStack(context)->stack;
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
154
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
155 struct Node* node = ALLOC_DATA(context, Node);
87
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
156 node->key = 0;
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
157 node->value = 0;
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
158 node->left = 0;
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
159 node->right = 0;
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
160
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
161 struct LoopCounter* counter = ALLOC_DATA(context, LoopCounter);
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 counter->i = 0;
87
9e139a340bd1 rename directory
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
163
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
164 struct Element* element = ALLOC_DATA(context, Element);
114
d05b9937aa95 Change element data from Task to Data
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
165 element->data = 0;
90
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
166 element->next = 0;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
167
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
168 ALLOC_DATA(context, Time);
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
169
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
170 struct Queue* activeQueue = ALLOC_DATA_TYPE(context, ActiveQueue, Queue);
90
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
171 activeQueue->first = 0;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
172 activeQueue->last = 0;
4b5bf5b40970 put queue
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
173 activeQueue->count = 0;
101
8987cf13d5bb Add Allocate macro
innparusu
parents: 95
diff changeset
174
109
059b26a250cc Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
175 struct Queue* waitQueue = ALLOC_DATA_TYPE(context, WaitQueue, Queue);
059b26a250cc Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
176 waitQueue->first = 0;
059b26a250cc Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
177 waitQueue->last = 0;
059b26a250cc Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
178 waitQueue->count = 0;
059b26a250cc Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
179
059b26a250cc Change put_queue process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
180 context->dataNum = Queue;
86
e06e1a9e569e create worker
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 }