Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 2.96 KB

README.md

File metadata and controls

58 lines (42 loc) · 2.96 KB

Muzuka-c

This is a collection of some modern skills for multithreading and concurrency in C++

  • Mutex
    • SpinlockMutex: A simple mutex implementation based on std::atomic_flag::test_and_set
    • DataMutex: A Rust-style mutex in C++
  • Task Queue
    • SimpleSerialTaskQueue: A simple serial queue implementation
    • TaskQueue: A general task queue running tasks in parallel. The concept is similar to SimpleSerialTaskQueue but it runs the tasks in several threads at the same time instead of running them sequentially
  • Ring Buffer
    • SPSCRingBuffer: A thread-safe single-producer-single-consumer circular buffer

Run the demo

Run run.sh <FOLDER_NAME> to play the examples, where the <FOLDER_NAME> is mutex, task_queue, or ring_buffer. Or you can simply go to those folder then build examples by running make and clean them by make clean.

Concurrent programming references

Lock-free

Code Examples

SPSC
MPMC
MPSC