LF MPMC queue improvements

Small improvements of the LF MPMC queue

Making the LF MPMC queue generic and in a seperate header file
This commit is contained in:
2026-03-09 13:21:45 +01:00
parent b2f444af00
commit a299c4a1e1
9 changed files with 230 additions and 148 deletions

View File

@@ -1,4 +1,3 @@
#include "arena.h"
#include "platform.h"
// ----------------------------- Globals ------------------------------------
@@ -475,7 +474,7 @@ int main(int argc, char **argv) {
arena_free(&gp_arena, (u8 **)&buf, len);
// Add some extra threads to overlap I/O more aggressively
size_t num_threads = hw_threads * 2;
u8 num_threads = hw_threads * 2;
if (num_threads < 2)
num_threads = 2;
@@ -527,9 +526,7 @@ int main(int argc, char **argv) {
WaitForMultipleObjects((DWORD)scan_threads, scan_tids, TRUE, INFINITE);
for (size_t i = 0; i < num_threads; i++) {
mpmc_push(&g_file_queue, NULL);
}
mpmc_producers_finished(&g_file_queue, num_threads);
atomic_store(&g_scan_done, 1);