$ show slembcke/Tina
Tina is a header-only library providing lightweight user-space threading through coroutines and fibers, along with a fiber-based job system for task scheduling. The core library (tina.h) implements symmetric and asymmetric coroutine APIs with platform-specific assembly for context switching. Tina Jobs (tina_jobs.h) builds on this to create a job scheduler featuring work-stealing via queue chaining, memory pooling, and fiber-based job execution to avoid OS thread overhead. The repository includes examples (e.g., Mandelbrot renderer using Sokol graphics) and tests demonstrating usage, but the project has migrated to Codeberg due to philosophical opposition to AI training, indicating the GitHub repository is no longer actively maintained. While the Sokol dependencies in extras are third-party, the Tina core showcases strong craftsmanship in low-level concurrency primitives.
The LLM identified 2 files worth highlighting for reuse:
Implements lightweight user-space threading via symmetric (fiber) and asymmetric (coroutine) APIs. Uses platform-specific assembly for efficient context switching. Header-only design allows zero-dependency integration. Supports multiple architectures (x86, ARM, RISC-V) and platforms.
A fiber-based job scheduler that avoids OS thread overhead by using Tina coroutines for job execution. Features work-stealing via queue chaining, priority queues, and memory pooling for efficient job object reuse. Provides synchronization primitives like job waiting and yielding.