This project demonstrates inter-process communication (IPC) using shared memory with Boost.Interprocess. It provides simple reader and writer examples to show how multiple processes can exchange data efficiently via shared memory.
- Shared memory communication using Boost.Interprocess
- Example writer and reader applications
- CMake-based build system
- Header-only interface for easy integration
shared_memory_boost_ipc/
├── include/
│ └── shared_ipc.hpp # Shared memory IPC interface
├── reader/
│ ├── reader.cpp # Reader example
│ └── CMakeLists.txt # Reader build config
├── writer/
│ ├── writer.cpp # Writer example
│ └── CMakeLists.txt # Writer build config
├── CMakeLists.txt # Top-level build config
├── LICENSE # License information
├── README.md # Project documentation
- C++17 or later
- Boost library (Interprocess module)
- CMake 3.10+
- Install Boost (ensure
boost_systemandboost_interprocessare available). - Clone this repository:
git clone https://github.com/JayTwoLab/shared_memory_boost_ipc.git cd shared_memory_boost_ipc - Create a build directory and run CMake:
mkdir build cd build cmake .. cmake --build .
- For fast search boost
cmake -S . -B build -DBOOST_ROOT=/usr -DBOOST_INCLUDEDIR=/usr/include -DBOOST_LIBRARYDIR=/usr/lib64 -DBoost_NO_SYSTEM_PATHS=ON -DBoost_DEBUG=ON - The executables for the reader and writer will be built in their respective folders.
- Start the writer process to create and write data to shared memory:
./writer/writer
- Start the reader process to read data from shared memory:
./reader/reader
This project is licensed under the terms of the LICENSE file in this repository.