save more
[cdsspec-compiler.git] / benchmark / mcs-lock / mcs-lock.h
index a165437bf320388f52a934feb4c28ba51d6ca645..d9165d124a5a517ce3d38570d7c3bac387e65df8 100644 (file)
@@ -94,9 +94,11 @@ public:
                        // unlock of pred can see me in the tail before I fill next
 
                        // publish me to previous lock-holder :
-                       // FIXME: detection miss, don't think it's necessary  
+                       // FIXME: detection miss, execution never ends
+                       // If this is relaxed, the store 0 to gate will be read before and
+                       // that lock will never ends.
                        pred->next.store(me, std::mo_release );
-                       printf("lock_miss1\n");
+                       //printf("lock_miss1\n");
 
                        // (*2) pred not touched any more       
 
@@ -106,8 +108,8 @@ public:
                        int my_gate = 1;
                        while (my_gate ) {
                                my_gate = me->gate.load(std::mo_acquire);
-                               if (my_gate == 0)
-                                       printf("lock at gate!\n");
+                               //if (my_gate == 0)
+                                       //printf("lock at gate!\n");
                                /**
                                        @Begin
                                        @Commit_point_define_check: my_gate == 0
@@ -133,9 +135,9 @@ public:
        void unlock(guard * I) {
                mcs_node * me = &(I->m_node);
 
-               // FIXME: detection miss, don't think it's necessary
+               // FIXME: detection miss, execution never ends
                mcs_node * next = me->next.load(std::mo_acquire);
-               printf("unlock_miss2\n");
+               //printf("unlock_miss2\n");
                if ( next == NULL )
                {
                        mcs_node * tail_was_me = me;
@@ -157,9 +159,9 @@ public:
                        // (*1) catch the race :
                        rl::linear_backoff bo;
                        for(;;) {
-                               // FIXME: detection miss, don't think it's necessary
+                               // FIXME: detection miss, execution never ends
                                next = me->next.load(std::mo_acquire);
-                               printf("unlock_miss3\n");
+                               //printf("unlock_miss3\n");
                                if ( next != NULL )
                                        break;
                                thrd_yield();