Skip to content
/ Q Public

Collection of public domain queue's by KjellKod

License

Notifications You must be signed in to change notification settings

KjellKod/Q

Repository files navigation

Q

Collection of public domain queue's by KjellKod All queues are in-process, thread-to-thread queues.

SPSC - single producer, single consumer

This lock-free queue is safe to use between one producer thread and one consumer thread. SPSC lock-free options:

  1. fixed_circular_fifo: Set the size of the queue in your code, the size is set during compiled time.
  2. circular_fifo: Set the size of the queue in the constructor.

The SPSC is a powerful building block from which you can create more lock-free complicated queue structures if number of producers and consumers are known at creation time.

Please see spsc documentation for details.

Benchmark testing

Please see benchmark documentation for details.

NOT YET DOCUMENTED API

  1. MPMC: multiple producer, multiple consumer
    • dynamically sized, mutex-lock-queue: runtime, at construction, set max size of queue or set to unlimited in size
  2. MPSC: multiple producer, singe consumer
    • lock-free circular fifo: Using fair scheduling the many SPSC queues are consumed in an optimized round-robin manner
  3. SPMC: single producer, multiple consumer
    • lock-free circular fifo: Using fair scheduling the producer transfers over many SPSC queues