benchmark for performance results
[cdsspec-compiler.git] / benchmark / ms-queue / my_queue.c
index 0d64ed8d168f312fdccae77efe13823a603167d9..1f4835ed70c8eaf9e65773664a83808b8da42cd9 100644 (file)
@@ -31,7 +31,7 @@ static unsigned int new_node()
                }
        }
        /* free_list is empty? */
-       MODEL_ASSERT(0);
+       //MODEL_ASSERT(0);
        return 0;
 }
 
@@ -42,7 +42,7 @@ static void reclaim(unsigned int node)
        int t = get_thread_num();
 
        /* Don't reclaim NULL node */
-       MODEL_ASSERT(node);
+       //MODEL_ASSERT(node);
 
        for (i = 0; i < MAX_FREELIST; i++) {
                /* Should never race with our own thread here */
@@ -57,7 +57,7 @@ static void reclaim(unsigned int node)
                }
        }
        /* free list is full? */
-       MODEL_ASSERT(0);
+       //MODEL_ASSERT(0);
 }
 
 void init_queue(queue_t *q, int num_threads)
@@ -105,7 +105,7 @@ void enqueue(queue_t *q, unsigned int val)
                tail = atomic_load_explicit(&q->tail, acquire);
                /****FIXME: miss ****/
                next = atomic_load_explicit(&q->nodes[get_ptr(tail)].next, acquire);
-               printf("miss1_enqueue\n");
+               //printf("miss1_enqueue\n");
                if (tail == atomic_load_explicit(&q->tail, relaxed)) {
 
                        /* Check for uninitialized 'next' */
@@ -136,9 +136,9 @@ void enqueue(queue_t *q, unsigned int val)
                                succ = atomic_compare_exchange_strong_explicit(&q->tail,
                                                &tail, value, release, relaxed);
                                if (succ) {
-                                       printf("miss2_enqueue CAS succ\n");
+                                       //printf("miss2_enqueue CAS succ\n");
                                }
-                               printf("miss2_enqueue\n");
+                               //printf("miss2_enqueue\n");
                                thrd_yield();
                        }
                }
@@ -170,12 +170,12 @@ unsigned int dequeue(queue_t *q)
                tail = atomic_load_explicit(&q->tail, relaxed);
                /****FIXME: miss ****/
                next = atomic_load_explicit(&q->nodes[get_ptr(head)].next, acquire);
-               printf("miss3_dequeue\n");
+               //printf("miss3_dequeue\n");
                if (atomic_load_explicit(&q->head, relaxed) == head) {
                        if (get_ptr(head) == get_ptr(tail)) {
 
                                /* Check for uninitialized 'next' */
-                               MODEL_ASSERT(get_ptr(next) != POISON_IDX);
+                               //MODEL_ASSERT(get_ptr(next) != POISON_IDX);
 
                                if (get_ptr(next) == 0) { // NULL
                                        /**
@@ -194,9 +194,9 @@ unsigned int dequeue(queue_t *q)
                                                MAKE_POINTER(get_ptr(next), get_count(tail) + 1),
                                                release, relaxed);
                                if (succ) {
-                                       printf("miss4_dequeue CAS succ\n");
+                                       //printf("miss4_dequeue CAS succ\n");
                                }
-                               printf("miss4_dequeue\n");
+                               //printf("miss4_dequeue\n");
                                thrd_yield();
                        } else {
                                value = load_32(&q->nodes[get_ptr(next)].value);