minor modifications
authorPeizhao Ou <peizhaoo@uci.edu>
Sat, 8 Feb 2014 01:34:03 +0000 (17:34 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Sat, 8 Feb 2014 01:34:03 +0000 (17:34 -0800)
benchmark/read-copy-update/rcu.cc
src/edu/uci/eecs/specCompiler/codeGenerator/CodeGenerator.java

index 8aad9d1..449463f 100644 (file)
@@ -105,6 +105,21 @@ void threadB(void *arg) {
        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
@@ -112,7 +127,7 @@ int user_main(int argc, char **argv) {
                @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;
@@ -122,9 +137,13 @@ int user_main(int argc, char **argv) {
 
        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;
 }
index 323ca98..9ebfe27 100644 (file)
@@ -292,7 +292,7 @@ public class CodeGenerator {
 //                              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"),
@@ -308,8 +308,8 @@ public class CodeGenerator {
 //                             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);