On Thu, Oct 06, 2022 at 12:12:21PM +0400, marcandre.lur...@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lur...@redhat.com>
> 
> The initial implementation was changing the pipe state created by GLib
> to PIPE_NOWAIT, but it turns out it doesn't work (read/write returns an
> error). Since reading may return less than the requested amount, it
> seems to be non-blocking already. However, the IO operation may block
> until the FD is ready, I can't find good sources of information, to be
> safe we can just poll for readiness before.

The downside is that we double the number of syscalls for each blocking
I/O. Doesn't matter if we do actually block, but if there was data
already pending, this is extra overhead.

But then this code never worked on Windows, so users will likely not
have performance expectations at this time.

> 
> Alternatively, we could setup the FDs ourself, and use UNIX sockets on
> Windows, which can be used in blocking/non-blocking mode. I haven't
> tried it, as I am not sure it is necessary.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
> ---
>  include/io/channel-command.h |  3 ++
>  io/channel-command.c         | 80 ++++++++++++++++++++++++++----------
>  2 files changed, 62 insertions(+), 21 deletions(-)

Reviewed-by: Daniel P. Berrangé <berra...@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to