Skip to content
Snippets Groups Projects
Commit 5bb165e9 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Merge branch 'make_liburcu_optional' into 'master'

make the userspace-rcu dependency optional

See merge request !28
parents 7094703f fdd628f5
No related branches found
No related tags found
1 merge request!28make the userspace-rcu dependency optional
Pipeline #52925 passed
......@@ -58,6 +58,10 @@ variables:
variables:
EMPER_WORKER_STATS: 'true'
.emper-userspace-rcu:
variables:
EMPER_USERSPACE_RCU: 'true'
.release-build:
variables:
BUILDTYPE: release
......@@ -105,3 +109,8 @@ test-with-stats:
extends:
- .test
- .emper-worker-stats
test-with-userspace-rcu:
extends:
- .test
- .emper-userspace-rcu
......@@ -8,7 +8,6 @@
// Non portable.
#include <sched.h> // for cpu_set_t, CPU_SET, CPU_ZERO
#include <sys/sysinfo.h> // for get_nprocs
#include <urcu.h> // for rcu_register_thread
#include <cstdlib> // for rand, srand, abort
#include <cstring>
......@@ -23,9 +22,14 @@
#include "Fiber.hpp" // for Fiber
#include "RuntimeStrategy.hpp" // for RuntimeStrategy
#include "RuntimeStrategyStats.hpp" // for RuntimeStrategyStats
#include "emper-config.h" // IWYU pragma: keep
#include "lib/DebugUtil.hpp"
#include "strategies/ws/WsStrategy.hpp" // for WsStrategy, WsStrategy::INST...
#ifdef EMPER_LIBURCU
#include <urcu.h> // for rcu_register_thread
#endif
#ifndef NDEBUG
#include <syscall.h> // for SYS_gettid
#include <unistd.h> // for syscall
......@@ -79,9 +83,9 @@ Runtime::Runtime(workerid_t workerCount, RuntimeStrategy& strategy, unsigned int
workerIds[i] = i;
auto thread_function = [](void* voidWorkerId) -> void* {
if constexpr (emper::LIBURCU) {
rcu_register_thread();
}
#ifdef EMPER_LIBURCU
rcu_register_thread();
#endif
return currentRuntime->workerLoop(voidWorkerId);
};
......
......@@ -12,14 +12,19 @@ project('EMPER', 'c', 'cpp',
add_project_arguments('-Wno-non-virtual-dtor', language: 'cpp')
thread_dep = dependency('threads')
liburcu_dep = dependency('liburcu')
emper_dependencies = [thread_dep, liburcu_dep]
emper_dependencies = [thread_dep]
run_target('iwyu',
command: 'tools/check-iwyu')
conf_data = configuration_data()
conf_data.set('EMPER_LIBURCU', get_option('userspace-rcu'))
option_urcu = get_option('userspace_rcu')
conf_data.set('EMPER_LIBURCU', option_urcu)
if option_urcu
liburcu_dep = dependency('liburcu')
emper_dependencies += [liburcu_dep]
endif
conf_data.set('EMPER_WORKER_SLEEP', get_option('worker_sleep'))
conf_data.set('EMPER_LOCKED_WS_QUEUE', get_option('locked_ws_queue'))
conf_data.set('EMPER_OVERFLOW_QUEUE', get_option('overflow_queue'))
......
option(
'userspace-rcu',
'userspace_rcu',
type: 'boolean',
value: true,
value: false,
description: 'Allow EMPER fibers to use userspace RCU',
)
option(
......
cc = meson.get_compiler('c')
liburcu_memb = cc.find_library('urcu-memb')
liburcu_cds = cc.find_library('urcu-cds')
liburcu_memb = option_urcu ? cc.find_library('urcu-memb') : disabler()
liburcu_cds = option_urcu ? cc.find_library('urcu-cds') : disabler()
tests = {
'SimpleFibTest.cpp':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment