From bb562ad125a027b24ec840bf7a2beafab8c53ec8 Mon Sep 17 00:00:00 2001 From: lucapegolotti Date: Wed, 9 Mar 2016 16:23:24 +0100 Subject: [PATCH] Add CMakeLists and script; improve code performance by decreasing ratio of enqueues/dequeues in the queue experiment --- linearizability_tester/CMakeLists.txt | 6 +++--- linearizability_tester/lt.cc | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/linearizability_tester/CMakeLists.txt b/linearizability_tester/CMakeLists.txt index 143cf20..55f0886 100644 --- a/linearizability_tester/CMakeLists.txt +++ b/linearizability_tester/CMakeLists.txt @@ -16,9 +16,9 @@ include_directories(../) # setting names of libraries set(PROJECT_LINK_LIBS -../build/base_cpp/libembb_base_cpp.a -../build/base_c/libembb_base_c.a -../build/containers_cpp/libembb_containers_cpp.a +${CMAKE_CURRENT_SOURCE_DIR}/../build/base_cpp/libembb_base_cpp.a +${CMAKE_CURRENT_SOURCE_DIR}/../build/base_c/libembb_base_c.a +${CMAKE_CURRENT_SOURCE_DIR}/../build/containers_cpp/libembb_containers_cpp.a ) diff --git a/linearizability_tester/lt.cc b/linearizability_tester/lt.cc index 1fe2d5a..2898ba8 100644 --- a/linearizability_tester/lt.cc +++ b/linearizability_tester/lt.cc @@ -51,8 +51,6 @@ #include #include #include -#include -// #include #ifdef _LT_TIMEOUT_ @@ -2797,7 +2795,7 @@ namespace lt ~Queue() { - dec_ref_counter(); + dec_ref_counter(); } Queue(const Queue& other) @@ -5040,7 +5038,7 @@ static void embb_worker_queue( { value = value_dist(rd); percentage = percentage_dist(rd); - if (percentage < 30) + if (percentage < 20) { call_entry_ptr = concurrent_log.push_back(state::Queue::make_try_enqueue_call(value)); ret = concurrent_queue.TryEnqueue(value); @@ -5154,6 +5152,7 @@ static void embb_experiment_queue(bool is_linearizable) int main() { + test_lru_cache(); test_atomic_op(); test_stack(); @@ -5231,11 +5230,11 @@ int main() embb::base::Thread::SetThreadsMaxCount(255); - std::cout << "Linearizability experiment on LockFreeStack" << std::endl; - // embb_experiment_stack>(true); std::cout << "Linearizability experiment on LockFreeMPMCQueue" << std::endl; embb_experiment_queue>(true); - return 0; + std::cout << "Linearizability experiment on LockFreeStack" << std::endl; + embb_experiment_stack>(true); + return 0; } -- libgit2 0.26.0