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

Fullness feedback for PacketIo, AKA futures::Sink equivalence. #3

Open
h33p opened this issue Nov 28, 2023 · 0 comments
Open

Fullness feedback for PacketIo, AKA futures::Sink equivalence. #3

h33p opened this issue Nov 28, 2023 · 0 comments

Comments

@h33p
Copy link
Member

h33p commented Nov 28, 2023

Currently PacketIo::send_io cannot fail. Of course, the implementation can reject the packet and return an appropriate error, however, handling these cases would be too error prone.

We need a mechanism to enable send_io to indicate the backend is full, and cooperatively wake the client up. However, this means every send_io call would need some sort of unique handle containing a waker, because we allow sharing the backend. Assuming the drop guarantee, we should be able to build an intrusive list of handles, for a truly zero-alloc solution.

This work is necessary for embedded use of mfio, or any memory constrained use-case. If mfio can lead to irrecoverable OOM panics, it cannot be relied on for building operating systems or used in embedded world.

The current workaround for this would be to create a reentrant backend, where reaching buffer limit implies the backend blocking the client until free space appears, however, this is a cumbersome method to work around OOM, and we shouldn't encourage it as a usage pattern.

@h33p h33p changed the title Fulness feedback for PacketIo, AKA futures::Sink equivalence. Fullness feedback for PacketIo, AKA futures::Sink equivalence. Nov 28, 2023
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

1 participant