2018-12-28 14:53:34 +08:00
build use tls::pointer instead of thread_local 2018-12-28 14:53:34 +08:00
include still has some bugs 2018-12-26 18:22:34 +08:00
src use tls::pointer instead of thread_local 2018-12-28 14:53:34 +08:00
test use tls::pointer instead of thread_local 2018-12-28 14:53:34 +08:00
.gitignore first commit for shm. 2018-11-20 11:27:39 +08:00
.travis.yml Update .travis.yml 2018-12-20 16:53:34 +08:00
LICENSE Update LICENSE 2018-12-27 17:01:44 +08:00
README.md use tls::pointer instead of thread_local 2018-12-28 14:53:34 +08:00

cpp-ipc - C++ IPC Library

MIT licensed Build Status

A high-performance inter-process communication using shared memory on Linux/Windows.
使用共享内存的跨平台Linux/Windowsx86/x64/ARM高性能IPC通讯库。

  • 需要支持C++17的编译器msvc-2017/gcc-7/clang-4
  • 除STL外无其他依赖
  • 无锁lock-free或轻量级shared-spin-lockipc::channel::connect/disconnect
  • 底层数据结构为循环数组circular array无动态内存分配
  • ipc::route支持单生产者多消费者1vN)ipc::channel支持多生产者多消费者NvM

Performance

Environment
Device Lenovo ThinkPad T450
CPU Intel(R) Core(TM) i5-4300U @ 2.5 GHz
RAM 16 GB
OS Windows 7 Ultimate x64
Compiler MSVC 2017 15.9.3

UT & benchmark test function, see: test

ipc::circ::queue

PROD-CONS: 1-N DATAS: 12bits * 1000000
1-1 072.150 ms, 0.072150 us/d
1-2 114.889 ms, 0.114889 us/d
1-4 155.712 ms, 0.155712 us/d
1-8 234.662 ms, 0.234662 us/d

ipc::route

PROD-CONS: 1-N DATAS: Random 2-256bits * 100000
RTT 185.862 ms, 1.85862 us/d
1-1 117.126 ms, 1.17126 us/d
1-2 174.284 ms, 1.74284 us/d
1-4 329.550 ms, 3.29550 us/d
1-8 494.970 ms, 4.94970 us/d

ipc::channel

PROD-CONS: N-M DATAS: Random 2-256bits * 100000
RTT 221.500 ms, 2.21500 us/d
1-1 141.013 ms, 1.41013 us/d
1-2 270.092 ms, 2.70092 us/d
1-4 609.792 ms, 6.09792 us/d
1-8 968.309 ms, 9.68309 us/d
2-1 313.916 ms, 1.56958 us/d
4-1 804.254 ms, 2.01064 us/d
8-1 1800.42 ms, 2.25053 us/d
2-2 550.972 ms, 2.75486 us/d
4-4 1942.46 ms, 4.85616 us/d
8-8 7684.91 ms, 9.60614 us/d

Reference