eio icon indicating copy to clipboard operation
eio copied to clipboard

Buf_write should have back-pressure

Open talex5 opened this issue 1 year ago • 2 comments

Buf_write writes allocate extra buffer space as needed. Currently there is no limit to how much. It would be good if it could suspend the calling fiber when some limit is reached and wait until some existing data has been consumed before continuing.

The easiest way would be to limit the number of internal buffers (which only requires checking on the slow allocation path). However, that does expose a detail of the internal buffering to users. Having an exact byte limit would make it easier to specify the behaviour precisely, but would perhaps be more expensive.

talex5 avatar Oct 04 '24 10:10 talex5

Hello @talex5 can i have more light on this

webbunivAdmin avatar Oct 30 '24 10:10 webbunivAdmin

Hi @webbunivAdmin. What particularly are you confused about?

Note: This is not an easy issue. As it says, it's not even clear what the correct behaviour should be. If you're looking for something else to work on, helping with "Go through the (Windows) backend and implement all the TODOs" from #125 would be very useful (e.g. grep for "not supported on windows yet").

talex5 avatar Nov 04 '24 12:11 talex5