public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Artyom Pavlov <[email protected]>, [email protected]
Subject: Re: Adding read_exact and write_all OPs?
Date: Wed, 3 Aug 2022 09:01:50 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 8/2/22 3:04 PM, Artyom Pavlov wrote:
> Greetings!
> 
> In application code it's quite common to write/read a whole buffer and
> only then continue task execution. The traditional approach is to wrap
> read/write sycall/OP in loop, which is often done as part of a
> language std. In synchronous context it makes sense because it allows
> to process things like EINTR. But in asynchronous (event-driven)
> context I think it makes a bit less sense.
> 
> What do you think about potential addition of OPs like read_exact and
> write_all, i.e. OPs which on successful CQE guarantee that an input
> buffer was processed completely? They would allow to simplify user
> code and in some cases to significantly reduce ring traffic.

That may make sense, and there's some precedence there for sockets with
the WAITALL flags.

-- 
Jens Axboe


  reply	other threads:[~2022-08-03 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 21:04 Adding read_exact and write_all OPs? Artyom Pavlov
2022-08-03 15:01 ` Jens Axboe [this message]
2022-08-16 17:11   ` Artyom Pavlov
2022-08-16 18:46   ` Stefan Metzmacher
2022-08-17 10:36     ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox