Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
/ chan Public archive

Chan is a cross-platform zero-copy multi-producer mutli-consumer asynchronous FIFO queue for passing messages between threads.

License

Notifications You must be signed in to change notification settings

nclack/chan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Chan

Chan is a cross-platfrom zero-copy multi-producer multi-consumer asynchronous FIFO queue written in C.

Build status

Introduction

I tried to keep the interface simple. See the detailed API docs for more. The documentation and testing framework have some examples of use.

Reading and writing to the queue are both performed via Chan_Next(). Whether a "read" or a "write" happens depends on the mode passed to Chan_Open(), which returns a reference-counted "reader" or "writer" reference to the queue.

Chan was designed so that Chan_Next() operations block the calling thread under some circumstances. With proper use, this design garauntees that certain networks of threads (namely, directed acyclic graphs) connected by Chan instances will deliver every message emited from a producer to a consumer in that network. Once the network is assembled, messages will be recieved in topological order.

Building

I use CMake to configure and build. There are no other dependencies besides that and a compiler such as gcc, Visual Studio, or clang.

Building usually looks like this:

 mkdir build
 cd build
 cmake ..
 make

About

Chan is a cross-platform zero-copy multi-producer mutli-consumer asynchronous FIFO queue for passing messages between threads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published