You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
h33p
changed the title
Fulness feedback for PacketIo, AKA futures::Sink equivalence.
Fullness feedback for PacketIo, AKA futures::Sink equivalence.
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 everysend_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.
The text was updated successfully, but these errors were encountered: