-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
runtime: poller should be used for file system operations #6222
Comments
We are talking about normal files of local hard drive. In windows world one can do async IO with any kind of IO HANDLE. I don't know what's the status of async file IO on linux. AIO is probably still broken. This page https://code.google.com/p/kernel/wiki/AIOUserGuide says that epoll should work, but a simple test shows that it does not. |
My 2 cents: I don't see much value in AIO for operations on block devices, but if integrating the runtime poller would allow concurrent Read/Write and Close operations above what POSIX semantics provides on file/pipe/char fds (similar to what we have on net fds), I see that as a valuable addition. |
This code seems to integrate Linux kernel AIO (as opposed to POSIX aio) with epoll. It also appears to integrate signal handling via epoll as well for what it's worth. http://marc.info/?l=linux-aio&m=129646725201847 |
Here is a nice implementation of Poller: It gives safe Close() in one goroutine while read/write operations are blocked in other goroutines and all read/write operations are released after close(). This package only implements linux epoll syscall. I think it could use golang runtime poller to make it multi platform. Thanks. |
I think that on tip this one is now done as much as it can be. Closing. |
Is there any possibility for future runtime poller support for file I/O ? |
Please don't comment on closed issues. Unlike many projects on GitHub, the Go project does not use its bug tracker for general discussion or asking questions. We only use our bug tracker for tracking bugs and tracking proposals going through the Proposal Process. Please see https://golang.org/wiki/Questions for good places to ask questions.
The limitation is the operating systems Go supports do not have good APIs for async file i/o. This isn't a complete answer, I know there is some kind of async i/o on linux, windows probably has something related to overlapping file operations or i/o completion ports (or something)--i've no idea what it would take for osx, freebsd, et al. The take away is it might be possible to support async file io for a subset of platforms, but it's nowhere near as straight forward as the support for async network io, and it would/will take an expert in each platform to implement it. |
The text was updated successfully, but these errors were encountered: