public inbox for [email protected]
 help / color / mirror / Atom feed
From: Artyom Pavlov <[email protected]>
To: [email protected]
Subject: Adding read_exact and write_all OPs?
Date: Wed, 3 Aug 2022 00:04:45 +0300	[thread overview]
Message-ID: <[email protected]> (raw)

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.

Best regards,
Artyom Pavlov.

             reply	other threads:[~2022-08-02 21:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 21:04 Artyom Pavlov [this message]
2022-08-03 15:01 ` Adding read_exact and write_all OPs? Jens Axboe
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] \
    /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