From 2cea1ba6faad510bbb6685a0d054df41b0209e65 Mon Sep 17 00:00:00 2001 From: Peizhao Ou Date: Wed, 7 Dec 2016 13:26:56 -0800 Subject: [PATCH] patches that old versions of the benchmarks (mcs-lock, rcu & seqlock) used --- mcs-lock/mcs-lock.cc.patch | 4 ++++ read-copy-update/rcu.cc.patch | 12 ++++++++++++ read-copy-update/rcu.h.patch | 6 ++++++ seqlock/seqlock.cc.patch | 16 ++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 mcs-lock/mcs-lock.cc.patch create mode 100644 read-copy-update/rcu.cc.patch create mode 100644 read-copy-update/rcu.h.patch create mode 100644 seqlock/seqlock.cc.patch diff --git a/mcs-lock/mcs-lock.cc.patch b/mcs-lock/mcs-lock.cc.patch new file mode 100644 index 0000000..14ecec9 --- /dev/null +++ b/mcs-lock/mcs-lock.cc.patch @@ -0,0 +1,4 @@ +81c81 +< tail_was_me,NULL,std::mo_release) ) { +--- +> tail_was_me,NULL,std::mo_acq_rel) ) { diff --git a/read-copy-update/rcu.cc.patch b/read-copy-update/rcu.cc.patch new file mode 100644 index 0000000..4754c2c --- /dev/null +++ b/read-copy-update/rcu.cc.patch @@ -0,0 +1,12 @@ +21,22c21,22 +< *data1 = res->data1; +< *data2 = res->data2; +--- +> *data1 = res->data1.load(memory_order_relaxed); +> *data2 = res->data2.load(memory_order_relaxed); +27,28c27,28 +< newPtr->data1 = prev->data1 + d1; +< newPtr->data2 = prev->data2 + d2; +--- +> newPtr->data1.store(prev->data1.load(memory_order_relaxed) + d1, memory_order_relaxed); +> newPtr->data2.store(prev->data2.load(memory_order_relaxed) + d2, memory_order_relaxed); diff --git a/read-copy-update/rcu.h.patch b/read-copy-update/rcu.h.patch new file mode 100644 index 0000000..c65f3e7 --- /dev/null +++ b/read-copy-update/rcu.h.patch @@ -0,0 +1,6 @@ +14,15c14,15 +< int data1; +< int data2; +--- +> atomic_int data1; +> atomic_int data2; diff --git a/seqlock/seqlock.cc.patch b/seqlock/seqlock.cc.patch new file mode 100644 index 0000000..cad8153 --- /dev/null +++ b/seqlock/seqlock.cc.patch @@ -0,0 +1,16 @@ +23c23 +< thrd_yield(); +--- +> //thrd_yield(); +38c38 +< thrd_yield(); +--- +> //thrd_yield(); +54c54 +< thrd_yield(); +--- +> //thrd_yield(); +61c61 +< thrd_yield(); +--- +> //thrd_yield(); -- 2.34.1