|
๐จ chic 0.0.0
Realtime-safe channels in C
|
Buffered channels, such as the Go programming language's chan or Plan 9's Channel, written in C17.
These channels are suitable for inter-process communication in realtime applications as they do not use mutex, semaphore, or anything else that blocks or requires a context switch. They synchronize using atomic operations only. They are intended to have better/bounded worst-case performance, even at the expense of average-case performance.
These channels support sending and receiving batches of items, and also provide methods to safely read and write directly to their underlying ringbuffer for zero-copy communication.
Chic provides four flavors of channels:
Chic is a work-in-progress and requires further testing and refinement before usage is advisable. That said, basic examples can be found in tests/*p*c_demo.c.
Chic depends on the CMake build system and the presence of a compiler that supports both C17 and <stdatomic.h>. The optional tests require support for <threads.h>.
Build Chic as a static library (preferred):
Build Chic as a dynamic library:
Documentation is available at rubiefawn.codeberg.page/chic.
HTML documentation can be built locally if you have Doxygen installed by running:
Chic is available under the terms of the Mozilla Public License, v. 2.0.
The intent is to allow anybody to freely use and link Chic to any other software under any other license, as long as Chic itself remains unmodified. If you modify Chic, those derivative works must be released under the MPL-2.0. In other words, use Chic freely for any purpose, but in turn, please freely share any changes you make to it.