Commit bb562ad1 by lucapegolotti

Add CMakeLists and script; improve code performance by decreasing ratio of…

Add CMakeLists and script; improve code performance by decreasing ratio of enqueues/dequeues in the queue experiment
parent 8760a847
...@@ -16,9 +16,9 @@ include_directories(../) ...@@ -16,9 +16,9 @@ include_directories(../)
# setting names of libraries # setting names of libraries
set(PROJECT_LINK_LIBS set(PROJECT_LINK_LIBS
../build/base_cpp/libembb_base_cpp.a ${CMAKE_CURRENT_SOURCE_DIR}/../build/base_cpp/libembb_base_cpp.a
../build/base_c/libembb_base_c.a ${CMAKE_CURRENT_SOURCE_DIR}/../build/base_c/libembb_base_c.a
../build/containers_cpp/libembb_containers_cpp.a ${CMAKE_CURRENT_SOURCE_DIR}/../build/containers_cpp/libembb_containers_cpp.a
) )
......
...@@ -51,8 +51,6 @@ ...@@ -51,8 +51,6 @@
#include <embb/base/thread.h> #include <embb/base/thread.h>
#include <embb/containers/lock_free_stack.h> #include <embb/containers/lock_free_stack.h>
#include <embb/containers/lock_free_mpmc_queue.h> #include <embb/containers/lock_free_mpmc_queue.h>
#include <locked_mpmc_queue.h>
// #include <locked_stack.h>
#ifdef _LT_TIMEOUT_ #ifdef _LT_TIMEOUT_
...@@ -2797,7 +2795,7 @@ namespace lt ...@@ -2797,7 +2795,7 @@ namespace lt
~Queue() ~Queue()
{ {
dec_ref_counter(); dec_ref_counter();
} }
Queue(const Queue& other) Queue(const Queue& other)
...@@ -5040,7 +5038,7 @@ static void embb_worker_queue( ...@@ -5040,7 +5038,7 @@ static void embb_worker_queue(
{ {
value = value_dist(rd); value = value_dist(rd);
percentage = percentage_dist(rd); percentage = percentage_dist(rd);
if (percentage < 30) if (percentage < 20)
{ {
call_entry_ptr = concurrent_log.push_back(state::Queue<N>::make_try_enqueue_call(value)); call_entry_ptr = concurrent_log.push_back(state::Queue<N>::make_try_enqueue_call(value));
ret = concurrent_queue.TryEnqueue(value); ret = concurrent_queue.TryEnqueue(value);
...@@ -5154,6 +5152,7 @@ static void embb_experiment_queue(bool is_linearizable) ...@@ -5154,6 +5152,7 @@ static void embb_experiment_queue(bool is_linearizable)
int main() int main()
{ {
test_lru_cache(); test_lru_cache();
test_atomic_op(); test_atomic_op();
test_stack(); test_stack();
...@@ -5231,11 +5230,11 @@ int main() ...@@ -5231,11 +5230,11 @@ int main()
embb::base::Thread::SetThreadsMaxCount(255); embb::base::Thread::SetThreadsMaxCount(255);
std::cout << "Linearizability experiment on LockFreeStack" << std::endl;
// embb_experiment_stack<embb::containers::LockFreeStack<char>>(true);
std::cout << "Linearizability experiment on LockFreeMPMCQueue" << std::endl; std::cout << "Linearizability experiment on LockFreeMPMCQueue" << std::endl;
embb_experiment_queue<embb::containers::LockFreeMPMCQueue<char>>(true); embb_experiment_queue<embb::containers::LockFreeMPMCQueue<char>>(true);
return 0; std::cout << "Linearizability experiment on LockFreeStack" << std::endl;
embb_experiment_stack<embb::containers::LockFreeStack<char>>(true);
return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment