Caterpillar

Daily Thought - 2024-11-13

< back to list

So I've been wondering if and how the approach taken by io_uring can apply to Caterpillar's host interface. I think the short answer is that right now, it wouldn't matter and would only add complication. But once Caterpillar is used in more challenging scenarios, maybe it could start to make sense.

The way io_uring works, is that instead of making a synchronous system call whose arguments are copied to the stack, or registers or whatever, you have two ring buffers shared between kernel and userspace: One for submitting system calls asynchronously, which is only writable by the userspace process. Another for receiving the results of those calls, which is only writable by the kernel.

The same concept could apply to Caterpillar, with one buffer for submitting calls to host functions, another for receiving the return values of those calls. The Caterpillar side could use some kind of async/await technique, or functional reactive programming, or whatever else will turn out to make sense, to deal with the asynchrony.

<< previous thoughtnext thought >>