comparison src/parallel_execution/twice.c @ 92:851da1107223

implement twice
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2016 08:50:30 +0900
parents src/parallel_execution/swap.c@9e139a340bd1
children 3e28ee215c0e
comparison
equal deleted inserted replaced
91:1e074c3878c7 92:851da1107223
1 #include <stdio.h>
2
3 #include "context.h"
4 #include "origin_cs.h"
5
6 __code twice(struct Context* context, int index, int* array) {
7 printf("No.%d %p\n", context->thread_num, context->thread);
8 array[index] = array[index]*2;
9
10 stack_pop(context->code_stack, &context->next);
11 goto meta(context, context->next);
12 }
13
14 __code twice_stub(struct Context* context) {
15 goto twice(context, context->data[Node]->node.value->array.index, context->data[Node]->node.value->array.array);
16 }
17