A Real-time Inter-Process Communication (IPC) mechanism and library
CDIPC is an Inter-Process Communication (IPC) mechanism and library. It is uniquely suited for coordinating perception, control drivers, and algorithms in real-time systems that sample data from physical processes.
CDIPC is similar to the ACH IPC library, but eliminates memory copy to improve efficiency. Other differences:
Data is shared between processes through shared memory.
The data structure is same for Topic and Service, the gray part is service only.
The publisher (/requester) and subscriber (/replier) are initialled statictly,
we could support dynamic registration, but it is not implemented for the moment because it is not commonly used.
The max data size of each node in each channel are the same.
Currently we use a single conditional variable instead of semaphores for simplification.
For use as service, only one replier is allowed.
We can simply add one or more subscriber to each topic and service dedicated for logging.
Note: The log subscriber in service nerver replier to requester.
make && sudo make install
There is a command line tool for test purpose, type cdipc --help
for more details,
or read the help message at the beginning of tools/cli_tool/cdipc_tool.c
.
Example for topic (run put command in another terminal):
cdipc create --name test # create a topic with 2 pub and 2 sub
# 5 nodes of 256 bytes by default
cdipc pend-cfg --name test # change max_len to 2 for first sub
# max_len is 0 and need_wait is false after create
cdipc get --name test # wait on sub id 0
cdipc put --name test # publish string "test msg" to the topic
Notes:
default values can override by arguments
...
The MIT License (MIT)
https://rem.mit-license.org