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:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "arena.h"
|
||||
#include "base.h"
|
||||
#include "lf_mpmc.h"
|
||||
#include "sm_mpmc.h"
|
||||
|
||||
#include "arena.c"
|
||||
#include <stdint.h>
|
||||
|
||||
Reference in New Issue
Block a user