Verified Commit 5db9043f authored by Tobias WEBER's avatar Tobias WEBER
Browse files

sqw: testing interproc shm emulation

parent c040589f
......@@ -19,6 +19,7 @@ option(USE_RtMp "use auxilliary libraries" TRUE)
option(USE_Dl "use dl libraries" TRUE)
option(USE_Py "search for python" TRUE)
option(USE_CUSTOM_THREADPOOL "use custom threadpool implementation" FALSE)
option(USE_INTERPROC_EMUL "force shared memory emulation mode" FALSE)
set(USE_TR1_FUNCS FALSE)
set(BUILD_EXT_TOOLS FALSE)
......@@ -92,6 +93,12 @@ if(USE_CUSTOM_THREADPOOL)
endif()
if(USE_INTERPROC_EMUL)
message("Using interprocess shared memory emulation mode.")
add_definitions(-D__USE_SQW_INTERPROC_EMUL__)
endif()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}" "."
"${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/tlibs")
set(CMAKE_BINARY_DIR "${CMAKE_SOURCE_DIR}")
......
......@@ -8,6 +8,21 @@
#ifndef __SQW_PROC_H__
#define __SQW_PROC_H__
#ifdef __USE_SQW_INTERPROC_EMUL__
#include <boost/interprocess/detail/workaround.hpp>
// try to avoid certain shared memory syscalls
#undef BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
#undef BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
#undef BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
#undef BOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
// force using emulation mode instead:
// https://www.boost.org/doc/libs/1_75_0/doc/html/interprocess/sharedmemorybetweenprocesses.html#interprocess.sharedmemorybetweenprocesses.sharedmemory.emulation
#define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION
//#define BOOST_INTERPROCESS_SHARED_DIR_PATH "/tmp/shared_mem"
#endif
#include "sqw.h"
#include <mutex>
#include <memory>
......
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 to comment