Skip to content
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

extend to support sockets via arbitrary file descriptors? #4

Open
subes opened this issue Apr 24, 2023 · 3 comments
Open

extend to support sockets via arbitrary file descriptors? #4

subes opened this issue Apr 24, 2023 · 3 comments

Comments

@subes
Copy link

subes commented Apr 24, 2023

Would be interesting to experiment with this as an alterantive to EPOLL as described here: https://blog.cloudflare.com/io_submit-the-epoll-alternative-youve-never-heard-about/

Though from what I see currently the API only supports actual "File" instances, not arbitrary file descriptors (which we can also extract from SocketChannels via reflection).

@subes subes changed the title extend to support sockets? extend to support sockets via arbitrary file descriptors? Apr 24, 2023
@subes
Copy link
Author

subes commented Apr 24, 2023

I guess we would only require an alternative constuctor for this class that allows to put in the fd pointer directly: https://github.com/zrlio/jaio/blob/master/src/main/java/com/ibm/jaio/File.java
The path is not used anyway?

@PepperJo
Copy link
Contributor

Yes you are correct. The path member is currently not used. So it should be an easy change. Feel free to create a PR which adds a constructor and removes the path member.
IMO the best current solution for Linux is to use io_uring: https://github.com/axboe/liburing/wiki/io_uring-and-networking-in-2023
Maybe someone already created a wrapper for Java?

@subes
Copy link
Author

subes commented Apr 24, 2023

Thanks for the quick answer and confirming my idea, will try that.

There is this netty integration: https://github.com/netty/netty-incubator-transport-io_uring
Dunno how easy it will be to use it without netty.

I will create a PR when I tackle alternatives to nio selector. Might take a few more weeks until I get to experimenting with jaio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants