-
Notifications
You must be signed in to change notification settings - Fork 27
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
Cancellation and file descriptors #22
Comments
Probably the way cancellation on Ring should work is that when you try to issue a new event on the FD Ring manages, if another event is underway, Ring issues a cancellation linked before the new event, so the ongoing event will be cancelled, then the new event will proceed, no matter what the two events are. And the Event API will want to provide a manually implement this behavior as well. |
@withoutboats That idea doesn't work for me - I'd like multiple independent operations working against the same fd (that is, multiple Rings operating against a single fd, along with Events and so on). io_uring's opcodes do not seek the file pointer internally afaict, so this should be easy from that perspective. For my use case, I'd like to see Ring be able to take an Rc or Arc to an AsRawFd object, then drop it when the Ring is dropped + all in-flight requests in that Ring referencing it are completed. I have implemented a similar thing for a custom Event. |
@VShell probably the ring state machine should be exposed as a low level interface you could use to build a shared ring construct. |
Hopefully avoided by #47, but I never got feedback on axboe/liburing#147 |
User sintrowel on Reddit comments:
I need to think about this more. With Event you're taking a raw FD, and its sort of your responsibility. But Ring should handle closing itself properly.
The problem is managing the lifecycle, because dropping the future representing a read/write is not the same as closing the FD. So you could cancel -> do more IO -> etc or you could cancel -> close. Ring probably needs to be more aware of the state of past IO interest that hasn't completed in some way.
The text was updated successfully, but these errors were encountered: