nim-sys icon indicating copy to clipboard operation
nim-sys copied to clipboard

do you mind to add io_uring support?

Open blackmius opened this issue 1 year ago • 4 comments

i think it is possible and not hard to add new ioqueue and procs on common structures which will run syscalls through io_uring

blackmius avatar Feb 15 '24 14:02 blackmius

It is possible, however this won't be done before the epoll backend is solid as we do need a reference to validate the queue.

alaviss avatar Feb 15 '24 14:02 alaviss

i imagined it different, it still uses sort of ioqueue but there is no wait and events, io_uring did it all under the kernel. As we dont need to wait when socket will be available it can be blocked in kernel we can use all existed proc implementations (socket_posix.writeImpl for example already would work) changes would be with syscall module. it needed to replace read/write/open/… syscall procs with same trannsfering it through io_uring

blackmius avatar Feb 15 '24 14:02 blackmius

It will become an offshoot module similar to ioqueue/iocp where a submission and wait functions will be provided (for iocp the submission is done by the read/write/etc syscalls directly, so it doesn't show up in ioqueue API)

alaviss avatar Feb 15 '24 14:02 alaviss

i made a small experiment to showcase what changes can be made to adopt io_uring

https://github.com/blackmius/nim-sys (last 2 commits)

blackmius avatar Feb 16 '24 13:02 blackmius