MPMC queues implementation

Now we have 3 different API compatible MPMC queues that we can swap with
swapping the header.
mt_mpmc.h, a blocking queue that uses a mutex/critical section.
lf_mpmc.h, a lock free queue that uses atomics.
sm_mpmc.h, a hybrid queue that uses atomics and a semaphore to block
when the queue is empty.
In this program, for max performance it is recommanded to use sm_mpmc.h
or mt_mpmc.h, they are designed to avoid busy waiting which frees more
CPU time to do useful work.
This commit is contained in:
2026-05-04 14:06:48 +01:00
parent 759fdfda1e
commit b8104b0fc7
3 changed files with 395 additions and 80 deletions

View File

@@ -2,7 +2,7 @@
#include "arena.h"
#include "base.h"
#include "lf_mpmc.h"
#include "sm_mpmc.h"
#include "arena.c"
#include <stdint.h>