One coroutine per event; threads come from a shared pool

Reaching co_await releases the thread; the reply resumes work where it stopped

One coroutine per event; threads come from a shared pool Reaching co_await releases the thread; the reply resumes work where it stopped message A · One coroutine per SPOT event message A task_t coroutine A · Architecture component task_t coroutine A timer tick · One coroutine per SPOT event timer tick task_t coroutine T · Architecture component task_t coroutine T message B · One coroutine per SPOT event message B task_t coroutine B · Architecture component task_t coroutine B worker thread pool · about one per CPU core · Architecture component worker thread pool about one per CPU core waiting coroutines · holding no thread · Architecture component waiting coroutines holding no thread co_await → suspend reply arrives → resume One coroutine per SPOT event

A coroutine is not a thread

  • • Each event gets its own coroutine, yet the thread count never grows — the pool holds about one thread per CPU core.
  • • A coroutine that reaches co_await releases its thread and holds none while waiting, so many waits never starve the pool.