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.
Currently
PacketIo::send_iocannot 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_ioto indicate the backend is full, and cooperatively wake the client up. However, this means everysend_iocall 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.