How alexanderlu09/coroutine-runtime works
Coroutine-Runtime is an early-stage C++ async runtime. Its current workflow queues tasks in a scheduler, runs their callbacks, and can poll a pluggable I/O driver; the kqueue driver can requeue tasks when descriptors become readable. Socket helpers create nonblocking listening and accepted sockets. The README also describes work stealing and deterministic simulation as goals, but the sampled source shows neither; ManualClock exists, but no simulator wiring is shown.
Main entry points: scheduler.hpp Scheduler · kqueue_driver.cpp Kqueue driver · socket.cpp Socket helpers · clock.cpp System clock
Components 12
Task scheduling
- Scheduler
include/coro/scheduler.hpp - Task
include/coro/task.hpp - Ready list
include/coro/intrusive_list.hpp
I/O and sockets
- I/O driver API
include/coro/io_driver.hpp - Kqueue driver
src/kqueue_driver.cpp - Socket helpers
src/socket.cpp
Time
- Clock API
include/coro/clock.hpp - System clock
src/clock.cpp - Manual clock
include/coro/clock.hpp
Other components
- Application
- OS kernel
- C++ steady clock
Connections 10
- Application → Scheduler: spawns tasks
- Scheduler → Ready list: queues tasks
- Scheduler → Task: runs callback
- Scheduler → I/O driver API: polls driver
- Kqueue driver → OS kernel: waits for events
- Kqueue driver → Scheduler: requeues ready tasks
- Application → Socket helpers: creates sockets
- Socket helpers → OS kernel: creates and accepts
- System clock → C++ steady clock: reads time
- Application → Manual clock: advances time