From: Eric Wong <normalperson@yhbt.net>
To: ruby.io.splice@librelist.com
Subject: Re: Some benchmarks
Date: Thu, 23 Dec 2010 18:06:26 +0000 [thread overview]
Message-ID: <20101223180626.GA21044@dcvr.yhbt.net> (raw)
In-Reply-To: AANLkTinWjEtU-aa-paHaw042jrt-AveWzwNfQqfhM1dS@mail.gmail.com
Iñaki Baz Castillo <ibc@aliax.net> wrote:
> 2010/12/22 Eric Wong <normalperson@yhbt.net>:
> > You can reuse the pipe object through multiple runs assuming you drain
> > it properly.
>
> So I need to learn what "draining a pipe" means. I assume I need to
> empty/rewind it. I suppose there ar API methods for this.
Just ensure you read everything from the pipe between each iteration
(which you seem to be doing). A pipe is just a ring buffer inside the
kernel. Traditionally write() puts data into the buffer, read() removes
it, and nowadays splice() can do it without copying the data into
userspace.
--
Eric Wong
next prev parent reply other threads:[~2010-12-23 18:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTi=M+qGa7G1PvYyB+fbJUzrersJQwtDkct3hZEiy@mail.gmail.com>
2010-12-22 14:01 ` Some benchmarks Iñaki Baz Castillo
2010-12-22 19:56 ` Eric Wong
2010-12-23 15:41 ` Iñaki Baz Castillo
2010-12-23 18:06 ` Eric Wong [this message]
2010-12-27 10:01 ` Iñaki Baz Castillo
2010-12-27 17:33 ` Iñaki Baz Castillo
2010-12-27 21:38 ` Eric Wong
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
List information: https://yhbt.net/ruby_io_splice/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101223180626.GA21044@dcvr.yhbt.net \
--to=normalperson@yhbt.net \
--cc=ruby.io.splice@librelist.com \
/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.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/ruby_io_splice.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).