Writing a C++20M:N Scheduler from Scratch (EBR, Work-Stealing)
Details
- External ID
- 47054517
- Source
- HN
- Company
- —
- Product
- Writing a C++20M:N Scheduler from Scratch (EBR, Work-Stealing)
- Website domain
- github.com
- Launched
- Feb. 17, 2026
- Cohort
- —
- Upvotes
- 18
- Upvotes percentile
- 0.6711590296495957
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:25 p.m.
- Updated at
- Sept. 7, 2026, 9:25 p.m.
Description
tiny_coro is a lightweight, educational M:N asynchronous runtime written from scratch using C++20 coroutines. It's designed to strip away the complexity of industrial libraries (like Seastar or Folly) to show the core mechanics clearly.Key Technical Features:M:N Scheduling: Maps M coroutines to N kernel threads (Work-Stealing via Chase-Lev deque).Memory Safety: Implements EBR (Epoch-Based Reclamation) to manage memory safely in lock-free structures without GC.Visualizations: I used Manim (the engine behind 3Blue1Brown) to create animations showing exactly how tasks are stolen and executed.Why I built it: To bridge the gap between "using coroutines" and "understanding the runtime." The code is kept minimal (~1k LOC core) so it can be read in a weekend.
Enrichment
- Theme
- systems tools and desktop utilities
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- scheduler implementation in c++
- Manually corrected
- False
Could you build this?
No Writing an asynchronous M:N runtime with epoch-based reclamation (EBR) and lock-free work-stealing queues in modern C++ requires cutting-edge systems programming and concurrency theory.
What it would actually take: The system requires implementing C++20 coroutine promise types, custom awaiters, and symmetric transfer to switch frames efficiently without OS thread intervention. Concurrency requires lock-free deques (e.g., Chase-Lev) for work-stealing schedulers and safe memory reclamation algorithms like epoch-based reclamation (EBR) to avoid ABA problems and use-after-free bugs. This demands advanced expertise in CPU memory models, atomic memory orderings (acquire/release), cache coherency, and low-level systems debugging.
Discussion
20 comments analyzed.
Competitors mentioned: Seastar, Boost.Coroutines, Felix, Erlang, Go
Concerns raised: C++20 coroutines have high complexity and steep learning curve, Stackless coroutines lack safety/isolation compared to stackful models like Erlang/Go, C++ ecosystem declining, Rust taking over, Per-stack memory overhead with stackful approaches
Feature requests: STM (Software Transactional Memory) support for better safety, Standard library wrappers to simplify C++20 coroutine usage
Competitors
Other products that read as similar to this one — 57 launches clear the similarity bar, closest 8 shown.
Attention rank: #26 of 58 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 109 days after the earliest competitor.
- C discrete event SIM w stackful coroutines runs 45x faster than SimPy · hn · 2026-02-03 · 69 upvotes · similarity 0.42
- genpark-async-event-loop-reactor-scheduler-skill · github · 2026-09-28 · 7 upvotes · similarity 0.42
- I wrote a minimal memory allocator in C · hn · 2025-11-23 · 137 upvotes · similarity 0.41
- Forkrun · hn · 2026-03-27 · 151 upvotes · similarity 0.40
- CCo · hn · 2026-08-03 · 5 upvotes · similarity 0.40
- genpark-work-stealing-thread-pool-deque-skill · github · 2026-09-28 · 7 upvotes · similarity 0.40
- genpark-work-stealing-thread-pool-deque-skill · github · 2026-09-28 · 7 upvotes · similarity 0.40
- Lockstep · hn · 2026-03-16 · 8 upvotes · similarity 0.39
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.