-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider restoring our old network poller code while using IO completion ports on Windows #344
Comments
With Windows support being dropped, making this change is easier as we don't need to use completion ports of wepoll. |
In the interest of reducing 3rd-party dependencies and maintaining control over our code, I would not only like to restore our old polling code in favour of the polling crate (inko-lang#344), but also switch to using rustix. The benefit of using rustix is that at least on Linux we can avoid libc calls. While this may result in a performance improvement, it's really more about slowly reducing our dependencies on 3rd-party libraries, including libc. The API might also be a bit more pleasant to use compared to using the libc crate directly. Changelog: changed
In the interest of reducing 3rd-party dependencies and maintaining control over our code, I would not only like to restore our old polling code in favour of the polling crate (#344), but also switch to using rustix. The benefit of using rustix is that at least on Linux we can avoid libc calls. While this may result in a performance improvement, it's really more about slowly reducing our dependencies on 3rd-party libraries, including libc. The API might also be a bit more pleasant to use compared to using the libc crate directly. Changelog: changed
In the interest of reducing 3rd-party dependencies and maintaining control over our code, I would not only like to restore our old polling code in favour of the polling crate (inko-lang#344), but also switch to using rustix. The benefit of using rustix is that at least on Linux we can avoid libc calls. While this may result in a performance improvement, it's really more about slowly reducing our dependencies on 3rd-party libraries, including libc. The API might also be a bit more pleasant to use compared to using the libc crate directly. Changelog: changed
In the interest of reducing 3rd-party dependencies and maintaining control over our code, I would not only like to restore our old polling code in favour of the polling crate (inko-lang#344), but also switch to using rustix. The benefit of using rustix is that at least on Linux we can avoid libc calls. While this may result in a performance improvement, it's really more about slowly reducing our dependencies on 3rd-party libraries, including libc. The API might also be a bit more pleasant to use compared to using the libc crate directly. Changelog: changed
In the interest of reducing 3rd-party dependencies and maintaining control over our code, I would not only like to restore our old polling code in favour of the polling crate (#344), but also switch to using rustix. The benefit of using rustix is that at least on Linux we can avoid libc calls. While this may result in a performance improvement, it's really more about slowly reducing our dependencies on 3rd-party libraries, including libc. The API might also be a bit more pleasant to use compared to using the libc crate directly. Changelog: changed
An approach I'm toying with is to move the low-level socket bits to the Inko standard library, only exposing some low-level bits to register sockets with the network poller, then using rustix for that. This would also help with #594, as we'd no longer depend on |
To add to that: the runtime still needs to keep track of some socket related data (e.g. the "registered" flag), but much of the actual IO work would happen in the standard library. |
Today I tried to update polling to 3.x, but this results in macOS socket test failures. The root cause is that the crate changed its implementation such that you can no longer
This however introduces several problems:
I'm going to revert polling back to 2.8.x for the time being, but replacing it entirely is starting to look more appealing. |
I'm going to open up this issue for contributions. While the work isn't necessarily easy, I think it should be suitable for somebody with decent knowledge of Rust looking to contribute to some projects. The work to be done is roughly as follows:
|
This fixes #344. Changelog: changed
This fixes #344. Changelog: changed
This fixes #344. Changelog: changed
This fixes #344. Changelog: changed
We used to have our own network polling code using epoll/kqueue/etc. While this was simple enough, it was replaced with the polling crate in bf39dbc. Since then maintenance of polling and the various smol-rs/async-std crates has slowed down considerably. In addition, we depend on wepoll-ffi through the polling crate, which requires a C compiler.
Looking at Go's network polling code for Windows (https://github.com/golang/go/blob/master/src/runtime/netpoll_windows.go) I was surprised by how little it seems to need to achieve something similar to epoll, at least on first sight. With that in mind I'm now considering it may not be a bad idea to restore the old network polling code, but use Windows IO completion ports instead of wepoll. This also gives us greater control over the polling logic and API. We should take care that when file descriptors are closed, they're also deregistered automatically. This is already the case for epoll and kqueue, but I'm not sure how this behaves when using IO completion ports.
The text was updated successfully, but these errors were encountered: