Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I recently tinkered around with io_uring for a presentation. Here is a toy echo server I made with it: https://gist.github.com/martinjacobd/be50a93744b94749339afe8... (non io_uring example for comparison: https://gist.github.com/martinjacobd/feea261d2fafe5e7332e37d...)

A big todo I have for this is to modify it to accept multishot_accept but I haven't been able to get a recent enough kernel configured properly to do it. (Only >6.0 kernels support multishot accept).

(edit) you need to s/multishot_accept/recv_multishot/g above :)



I did an echo server with multi-shot here (using the io_uring rust bindings) https://github.com/thinkharderdev/io-uring/blob/ring-mapped-.... My biggest issue with io_uring is figuring out what is available in which kernel version :)


I meant recv_multishot not multishot_accept. The one I linked does use multishot_accept. Just a think-o. Looks like your version uses both though, so that's cool.


this might help: https://sourcedigger.io


Oh that's awesome! Thanks!


I might have to use your code again, I used your Just in time compilation code to execute generated machine code.

Thank you so much Martin Jacob!


Absolutely my pleasure. I tracked down the problem you commented about: I used a later version of liburing than ships with Ubuntu, so if you want to compile this as-is, you'll have to compile and install liburing from source probably. Glad you enjoyed it!


I'll be sure to follow everything you work on because you work on self-contained easy to understand code that shows APIs effectively.

The things you work on are foundations to extremely useful systems.

(My JIT compiler is based on Martin Jacob's JIT code https://github.com/samsquire/compiler )

I would love to change my epoll server to use liburing and if I feel confident enough to I'll try integrate your code into it.

https://github.com/samsquire/epoll-server


Could you also do an udp based server? It’d be interesting


I don't see why not. You'd open the socket on line 124 as a SOCK_DGRAM, 0 rather than what it is now for TCP. For an echo server, for instance, you wouldn't listen on the socket or accept requests; instead, you'd use io_uring_prep_recvmsg and use the prepended msghdr to send the identical packet back out with io_uring_prep_sendmsg.

At least, that's my untested understanding.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: