
11 Jul
2019
11 Jul
'19
6:59 a.m.
On 7/10/19 4:07 PM, Marc-André Lureau wrote:
On Wed, Jul 10, 2019 at 10:12 PM Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
To avoid blocking on a write on a pipe that the receiving process does not read from, write only MAX_PIPE_FEED_BYTES into the pipe so that we can serve other pipes as well. why not simply use non-blocking write?
I had thought I would use non-blocking write, but... If we now have a large buffer and a pipe with less capacity and O_NONBLOCK is set, would we ever be able to make write progress or always get EAGAIN or EWOULDBLOCK? Probably what we would need is O_NONBLOCK combined with a small amount of bytes to write, like in this patch.