$ show dougbinks/enkiTS
enkiTS is a lightweight, permissively licensed C and C++ task scheduler library designed for parallel programming on multicore CPUs. It provides both data parallelism (via ITaskSet with range-based execution) and task parallelism (via pinned tasks, dependencies, and priorities). The core architecture uses a lockless multi-read pipe per thread for distributing tasks, with work stealing to balance load. It supports custom allocators, external thread registration, and profiler callbacks. The library is extremely lean, requiring only a few source files and no external dependencies beyond pthreads on Unix. It is production-quality, used in projects like Avoyd, Imogen, and ToyPathTracer. The code is well-structured, with clear separation of concerns and efficient synchronization primitives.
The LLM identified 1 files worth highlighting for reuse:
A templated lockless multi-read single-writer pipe (LockLessMultiReadPipe) and a lockless multi-writer intrusive list (LocklessMultiWriteIntrusiveList). The pipe uses atomic compare-and-swap on flags to control access, with power-of-two sizing for efficient modulo operations. It is self-contained, has no internal dependencies beyond standard atomics, and can be extracted and reused in any C++ project needing a thread-safe queue for single-producer, multiple-consumer scenarios. The intrusive list is also generic and useful for any type with a 'pNext' member.