Coder Social home page Coder Social logo

nclack / chan Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 2.0 327 KB

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

Home Page: http://nclack.github.com/chan/

License: MIT License

C++ 19.28% C 76.04% CMake 4.69%

chan's Introduction

#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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.