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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d7e8058 · Feb 19, 2024

History

69 Commits
Dec 12, 2023
Dec 12, 2023
Feb 19, 2024
Jan 22, 2024
Jan 22, 2024
Jan 22, 2024
Jan 22, 2024
Dec 12, 2023
Jan 4, 2024
Apr 26, 2018
Jan 4, 2024
Apr 26, 2018
Apr 20, 2018
Jan 4, 2024
Apr 20, 2018
Dec 16, 2023
Jan 4, 2024

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