2018-12-28 16:07:16 +08:00
build -Wno-attributes 2018-12-28 15:04:21 +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 eliminate warnings 2018-12-28 16:07:16 +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 eliminate warnings 2018-12-28 16:07:16 +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.4

UT & benchmark test function, see: test

ipc::circ::queue

PROD-CONS: 1-N DATAS: 12bits * 1000000
1-1 75.9460 ms, 0.075946 us/d
1-2 106.582 ms, 0.106582 us/d
1-4 136.317 ms, 0.136317 us/d
1-8 148.197 ms, 0.148197 us/d

ipc::route

PROD-CONS: 1-N DATAS: Random 2-256bits * 100000
RTT 165.798 ms, 1.65798 us/d
1-1 137.251 ms, 1.37251 us/d
1-2 197.695 ms, 1.97695 us/d
1-4 396.113 ms, 3.96113 us/d
1-8 487.245 ms, 4.87245 us/d

ipc::channel

PROD-CONS: N-M DATAS: Random 2-256bits * 100000
RTT 276.056 ms, 2.76056 us/d
1-1 145.875 ms, 1.45875 us/d
1-2 298.616 ms, 2.98616 us/d
1-4 633.239 ms, 6.33239 us/d
1-8 1113.56 ms, 11.1356 us/d
2-1 459.178 ms, 2.29589 us/d
4-1 768.695 ms, 1.92174 us/d
8-1 1820.28 ms, 2.27535 us/d
2-2 576.380 ms, 2.88190 us/d
4-4 2060.98 ms, 5.15245 us/d
8-8 7355.66 ms, 9.19458 us/d

Reference