I stopped changing the implementation often enough, so I think now I can show everyone
well, I think that curbing io_uring has opened a pandora's box, which entails rewriting a huge part of the existing synchronous code. I'm not only talking about replacing read/write calls in such systems, but also that with io_uring you can create new file descriptors and change their attributes without using syscall.
it would be advisable to replace all calls that use syscall with a new analog. that is, those that we often do not notice in our work. For example, getting an address from a domain name.
However, another challenge to achieve a non-blocking asynchronous system is TLS, the implementation of which relies on a third-party library and in general there is more computation than io
I saw an interesting project that tried to solve these problems https://github.com/fantix/kloop
And after all, the performance of a system that minimized the cost of io as much as possible by delegating everything to the kernel still depends on how it is used. I mean that the event loop, which will process events, does not always wait for events, but does some work, while the count of pending events in event queue is increasing from. So there must be something else multi-threaded, for which I have not yet seen a good solution either in nim nor in other languages
I consider that before adding a library to std, we should first try to implement several working applications on it. To understand how well the current API turned out. Otherwise, several iterations of deprecated are coming. so I invite you to test the library.
well, it's worth considering that the library currently covers only sending and receiving requests to the kernel. When io_uring supports ways to register different structures in the kernel (26 ops in total). And there are 8 of them, which I wrapped in a convenient way
And yet, at first I did one big function that combine both arguments and userData. Therefore, now there are 2 versions of procedures that do the same thing. And I do not know if it is worth removing them in favor of others, since they are made using them