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(../)
# 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
)
......
......@@ -51,8 +51,6 @@
#include <embb/base/thread.h>
#include <embb/containers/lock_free_stack.h>
#include <embb/containers/lock_free_mpmc_queue.h>
#include <locked_mpmc_queue.h>
// #include <locked_stack.h>
#ifdef _LT_TIMEOUT_
......@@ -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<N>::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<embb::containers::LockFreeStack<char>>(true);
std::cout << "Linearizability experiment on LockFreeMPMCQueue" << std::endl;
embb_experiment_queue<embb::containers::LockFreeMPMCQueue<char>>(true);
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