add sleeps back
authorweiyu <weiyuluo1232@gmail.com>
Sun, 13 Dec 2020 05:53:52 +0000 (21:53 -0800)
committerweiyu <weiyuluo1232@gmail.com>
Sun, 13 Dec 2020 05:53:52 +0000 (21:53 -0800)
cdschecker_modified_benchmarks/barrier/barrier.cc
cdschecker_modified_benchmarks/dekker-fences/dekker-fences.cc
cdschecker_modified_benchmarks/linuxrwlocks/linuxrwlocks.cc
cdschecker_modified_benchmarks/mcs-lock/mcs-lock.cc
cdschecker_modified_benchmarks/mpmc-queue/mpmc-queue.cc
cdschecker_modified_benchmarks/test.sh

index 4d3c8ba2146a8928d17c2d6c50768919e697ae17..28023fcdbb17e058afc827496dc341510fbe3e33 100644 (file)
@@ -11,14 +11,14 @@ int var = 0;
 
 void threadA(void *arg)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        store_32(&var, 1);
        barr->wait();
 }
 
 void threadB(void *arg)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        barr->wait();
        printf("var = %d\n", load_32(&var));
 }
index 30a3633533db7d0f2094b10f4f99ce172fe8681d..71ef87b894a8937cab993e4cd8587332cc0c37f0 100644 (file)
@@ -19,7 +19,7 @@ uint32_t var = 0;
 
 void p0()
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
 
        flag0.store(true,std::memory_order_relaxed);
        //std::atomic_thread_fence(std::memory_order_seq_cst);
@@ -50,7 +50,7 @@ void p0()
 
 void p1()
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
 
        flag1.store(true,std::memory_order_relaxed);
        std::atomic_thread_fence(std::memory_order_seq_cst);
index 73e3a6833efe6968df7480781f517e499e72adb9..d03d179088d3c01a26ff6b02d0803bd98efff8fa 100644 (file)
@@ -83,7 +83,7 @@ int shareddata;
 
 void a()
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        int i, rs;
        for(i = 0; i < 2; i++) {
                if ((i % 2) == 0) {
index 4fc4f0f26fc03747364d0e3a8d45105bccd58193..5b8bce7e78be934e8cc7f09305a565c15e0e706d 100644 (file)
@@ -11,7 +11,7 @@ static uint32_t shared;
 
 void threadA(void *arg)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        mcs_mutex::guard g(mutex);
        printf("store: %d\n", 17);
        store_32(&shared, 17);
@@ -22,7 +22,7 @@ void threadA(void *arg)
 
 void threadB(void *arg)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        mcs_mutex::guard g(mutex);
        printf("load: %u\n", load_32(&shared));
        mutex->unlock(&g);
index 038fac37230f9783d3db7f383cd10ae0ac4c1ada..e495f4f0ea4b521d838f2df40b4840f09201a8a9 100644 (file)
@@ -10,7 +10,7 @@
 
 void threadA(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        int32_t *bin = queue->write_prepare();
        store_32(bin, 1);
        queue->write_publish();
@@ -18,7 +18,7 @@ void threadA(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
 
 void threadB(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        int32_t *bin;
        while ((bin = queue->read_fetch()) != NULL) {
                printf("Read: %d\n", load_32(bin));
@@ -28,7 +28,7 @@ void threadB(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
 
 void threadC(struct mpmc_boundq_1_alt<int32_t, sizeof(int32_t)> *queue)
 {
-//     std::this_thread::sleep_for(std::chrono::milliseconds(10));
+       std::this_thread::sleep_for(std::chrono::milliseconds(10));
        int32_t *bin = queue->write_prepare();
        store_32(bin, 1);
        queue->write_publish();
index 1fd5d1f50459b3930269e68e184c81522036f42a..d5f92dceda44355468e9d5cf79f76f9e7193c311 100755 (executable)
@@ -2,10 +2,6 @@
 
 EXE=$1
 TOTAL_RUN=500
-CDSLIB="/home/vagrant/c11tester"
-export LD_LIBRARY_PATH=${CDSLIB}
-export C11TESTER='-x1'
-
 COUNT_DATA_RACE=0
 COUNT_TIME=0