Implementing custom cooperative multitasking in Rust
reddit.com·11h·
Discuss: r/rust
⚙️Systems Programming
Preview
Report Post

I’m writing a database on top of io_uring and the NVMe API. I’m using a custom event loop rather than Rust native async/await because I want to use some dirty tricks like zero copy send/receive and other performance improvements. My main concerns are thin tails (p99 very close to p50) and performance.

Let’s say we have some operations that are time consuming, could it be computationally expensive or IO bound, but that is possible to split in blocks. Rather than blocking the event loop and perform the operation in one step I would like to use state machines to perform blocks of the task, yield to the event loop, and then continue when there is less pressure.

My questions are:

Is this a good idea? Does anyone have any pointers to how to best implement this?

Keeping in mind t…

Similar Posts

Loading similar posts...