edits
authorPeizhao Ou <peizhaoo@uci.edu>
Fri, 19 Feb 2016 09:34:35 +0000 (01:34 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Fri, 19 Feb 2016 09:34:35 +0000 (01:34 -0800)
benchmark/chase-lev-deque-bugfix/deque.c
generate.sh [new file with mode: 0755]
src/edu/uci/eecs/codeGenerator/CodeGenerator.java

index 9c6625e..ff28527 100644 (file)
@@ -26,12 +26,6 @@ Deque * create() {
 */
 int take(Deque *q) {
        size_t b = atomic_load_explicit(&q->bottom, memory_order_relaxed) - 1;
-       /**
-               @Begin
-               @Commit_point_define_check: true
-               @Label: TakeReadBottom
-               @End
-       */
        Array *a = (Array *) atomic_load_explicit(&q->array, memory_order_relaxed);
        atomic_store_explicit(&q->bottom, b, memory_order_relaxed);
        /**** SPEC (sequential) (testcase1.c) ****/
@@ -39,13 +33,6 @@ int take(Deque *q) {
        size_t t = atomic_load_explicit(&q->top, memory_order_relaxed);
        int x;
        if (t <= b) {
-               /**
-                       @Begin
-                       @Commit_point_clear: true
-                       @Label: TakeClear1
-                       @End
-               */
-
                /* Non-empty queue. */
                int size = atomic_load_explicit(&a->size,memory_order_relaxed);
                x = atomic_load_explicit(&a->buffer[b % size], memory_order_relaxed);
@@ -61,20 +48,6 @@ int take(Deque *q) {
                        bool succ = atomic_compare_exchange_strong_explicit(&q->top, &t, t +
                                1, memory_order_seq_cst, memory_order_relaxed);
                        if (!succ) {
-                               /**
-                                       @Begin
-                                       @Commit_point_clear: true
-                                       @Label: TakeClear2
-                                       @End
-                               */
-
-                               /**
-                                       @Begin
-                                       @Commit_point_define_check: true
-                                       @Label: TakeReadTop
-                                       @End
-                               */
-
                                /* Failed race. */
                                x = EMPTY;
                        }
@@ -131,12 +104,8 @@ void push(Deque *q, int x) {
        int size = atomic_load_explicit(&a->size, memory_order_relaxed);
 
        atomic_store_explicit(&a->buffer[b % size], x, memory_order_relaxed);
-       /**
-               @Begin
-               @Commit_point_define_check: true
-               @Label: PushUpdateBuffer
-               @End
-       */
+       /** @OPDefine: true */
+
        /**** UL & SPEC (Sync) (run with -u100 to avoid the uninitialized bug) ****/
        atomic_thread_fence(memory_order_release);
        atomic_store_explicit(&q->bottom, b + 1, memory_order_relaxed);
diff --git a/generate.sh b/generate.sh
new file mode 100755 (executable)
index 0000000..0e08640
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+BENCH=(register ms-queue linuxrwlocks mcs-lock chase-lev-deque-bugfix)
+
+java -cp classes edu/uci/eecs/codeGenerator/CodeGenerator ${BENCH[*]}
index a86c2cb..02c6067 100644 (file)
@@ -318,9 +318,10 @@ public class CodeGenerator {
        }
 
        static public void main(String[] args) {
-               String[] dirNames = { Environment.REGISTER, Environment.MS_QUEUE,
-                               Environment.LINUXRWLOCKS, Environment.MCS_LOCK,
-                               Environment.DEQUE };
+//             String[] dirNames = { Environment.REGISTER, Environment.MS_QUEUE,
+//                             Environment.LINUXRWLOCKS, Environment.MCS_LOCK,
+//                             Environment.DEQUE };
+               String[] dirNames = args;
 
                for (int i = 0; i < dirNames.length; i++) {
                        String dirName = dirNames[i];