printf("ThreadB data3: %d\n", dataB->data3);
}
+void threadC(void *arg) {
+ Data *dataC = read();
+ printf("ThreadC data1: %d\n", dataC->data1);
+ printf("ThreadC data2: %d\n", dataC->data2);
+ printf("ThreadC data3: %d\n", dataC->data3);
+}
+
+void threadD(void *arg) {
+ Data *dataD = (Data*) malloc(sizeof(Data));
+ dataD->data1 = -3;
+ dataD->data2 = -2;
+ dataD->data3 = -1;
+ write(dataD);
+}
+
int user_main(int argc, char **argv) {
/**
@Begin
@End
*/
- thrd_t t1, t2;
+ thrd_t t1, t2, t3, t4;
data.store(NULL, memory_order_relaxed);
Data *data_init = (Data*) malloc(sizeof(Data));
data_init->data1 = 1;
thrd_create(&t1, threadA, NULL);
thrd_create(&t2, threadB, NULL);
+ //thrd_create(&t3, threadC, NULL);
+ //thrd_create(&t4, threadD, NULL);
thrd_join(t1);
thrd_join(t2);
+ //thrd_join(t3);
+ //thrd_join(t4);
return 0;
}
// new File(homeDir + "/benchmark/ms-queue/main.c"),
// new File(homeDir + "/benchmark/ms-queue/my_queue.h") };
-// new File(homeDir + "/benchmark/read-copy-update/rcu.cc") };
+ new File(homeDir + "/benchmark/read-copy-update/rcu.cc") };
// new File(homeDir +
// "/benchmark/chase-lev-deque-bugfix/deque.c"),
// new File(homeDir + "/benchmark/spsc-bugfix/eventcount.h"),
// new File(homeDir + "/benchmark/spsc-bugfix/queue.h") };
- new File(homeDir + "/benchmark/mpmc-queue/mpmc-queue.h"),
- new File(homeDir + "/benchmark/mpmc-queue/mpmc-queue.cc") };
+// new File(homeDir + "/benchmark/mpmc-queue/mpmc-queue.h"),
+// new File(homeDir + "/benchmark/mpmc-queue/mpmc-queue.cc") };
CodeGenerator gen = new CodeGenerator(srcFiles);