This is an automated archive made by the Lemmit Bot.

The original was posted on /r/rust by /u/nikhilgarg28 on 2026-01-20 07:51:35+00:00.


I often find myself wanting to model my systems as shared-nothing thread-per-core async systems that don’t do work-stealing. While tokio has single-threaded runtime mode, its scheduler is rather rigid and optimizes for throughput, not latency. Further, it doesn’t support notion of different priority queues (e.g. to separate background and latency sensitive foreground work) which makes it hard to use in certain cases. Seastar supports this and so does Glommio (which is inspired from Seastar). However, whenever I’d go down the rabbit hole of picking another runtime, I’d eventually run into some compatibility wall and give up - tokio is far too pervasive in the ecosystem.

So I recently wrote Clockworker - a single threaded async executor which can sit on top of any other async runtime (like tokio, monoio, glommio, smol etc) and exposes very powerful and configurable scheduling semantics - semantics that go well beyond those of Seastar/Glommio.

Semantics: it exposes multiple queues with per-queue CPU share into which tasks can be spawned. Clockworker has two level scheduler - at the top level, Clockworker chooses a queue based on its fair share of CPU (using something like Linux CFS/EEVDF) and then it choose a task from the queue based on queue specific scheduler. You can choose a separate scheduler per queue by using one of the provided implementations or write your own by implementing a simple trait. It also exposes a notion of task groups which you can optionally leverage in your scheduler to say provide fairness to tenants, or grpc streams, or schedule a task along with its spawned children tasks etc.

It’s early and likely has rough edges. I have also not had a chance to build any rigorous benchmarks so far and stacking an executor over another likely has some overhead (but depending on the application patterns, may be justified due to better scheduling).

Would love to get feedback from the community - have you all found yourself wanting something like this before and if so, what direction would you want to see this go into?