ruby_io_splice.git  about / heads / tags
zero-copy pipe I/O for Linux and Ruby
$ git log --pretty=format:'%h %s (%cs)%d'
44f1e91 Ruby io_splice 4.4.2 - URL + doc updates (2020-02-22)
	(HEAD -> master, tag: v4.4.2)
2b91616 doc: update URLs to point to YHBT.net (2020-02-22)
aa15afd Ruby io_splice 4.4.1 - minor updates (2019-01-02)
	(tag: v4.4.1)
b0a2c6b README: add a note on sleepy_penguin providing splice + tee (2019-01-02)
e942ee5 doc: update URLs to HTTPS and remove refs to mail software (2019-01-02)
c7699c7 pkg.mk: build system updates (2019-01-02)
52fd33d io/splice: fix mismatched indentation warnings (2018-05-18)
2125433 Ruby io_splice 4.4.0 - minor updates (2015-01-11)
	(tag: v4.4.0)
c791ca7 gemspec: remove dead wrongdoc stuff (2015-01-11)
a5da14b doc updates (2015-01-11)
...

$ git cat-file blob HEAD:README
= io_splice - zero-copy pipe I/O for Linux and Ruby

The splice family of Linux system calls can transfer data between file
descriptors without the need to copy data into userspace.  Instead of a
userspace buffer, they rely on an ordinary Unix pipe as a kernel-level
buffer.  The `splice' and `tee' syscalls are also provided by the
{sleepy_penguin}[https://yhbt.net/sleepy_penguin/] library.
"io_splice" remains maintained for old applications or users
experimenting with the vmsplice syscalls

== Features

* Efficient zero-copy I/O avoids data copies into userspace,
  reducing garbage for the Ruby garbage collector as a side effect.

* More flexible than sendfile, may be used to enable copies between
  arbitrary file descriptors (assuming kernel support), not just
  file-to-socket (or file-to-anything in newer Linux).

* Thread-safe blocking operations under Ruby 1.9+, releases GVL
  if blocking operations are used.

* Safely usable with non-blocking I/O frameworks (unlike IO.copy_stream)
  when combined with the IO::Splice::F_NONBLOCK flag.

* Fully-documented library API and
  {examples}[https://yhbt.net/ruby_io_splice/examples/]

* Adds helpful IO#pipe_size and IO#pipe_size= accessor methods for
  resizing the pipe buffer in Linux 2.6.35 or later.

== Install

Operating system support for the splice(2), tee(2) and vmsplice(2)
system calls is required.  Currently, only Linux 2.6.17 or later with a
modern C library (glibc 2.5 or later) support these system calls.  Using
the latest stable Linux kernel is *HIGHLY* recommended as there have
been numerous bugs in the early releases of these system calls.

If you're using a packaged Ruby distribution, make sure you have a C
compiler and the matching Ruby development libraries and headers.

If you use RubyGems:

    gem install io_splice

Otherwise grab the latest tarball from:

https://yhbt.net/ruby_io_splice/files/

Unpack it, and run "ruby setup.rb"

== Usage

Our API matches the C API closely, see the RDoc for full API
documentation and the Linux manpages for more details.

All of these system calls are fairly new have seen limited usage
anywhere, even outside of the Ruby world.

If you encounter problems (privilege escalation, memory leaks (in the
kernel), poor performance, corrupt data, etc..), try upgrading the Linux
kernel to the latest stable version.

These system calls have a lot of potential, and will hopefully be
standardized and available in non-Linux kernels some day.

== Development

You can get the latest source via git from the following locations:

  https://yhbt.net/ruby_io_splice.git
  https://repo.or.cz/w/ruby_io_splice.git (mirror)

You may browse the code from the web and download the latest snapshot
tarballs here:

* https://yhbt.net/ruby_io_splice.git
* https://repo.or.cz/w/ruby_io_splice.git (gitweb)

Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch, but attachments are fine, too.

We will adhere to mostly the same conventions for patch submissions as
git itself.  See the Documentation/SubmittingPatches document
distributed with git on on patch submission guidelines to follow.  Just
don't email the git mailing list or maintainer with io_splice patches.

== Contact

All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list: mailto:ruby-io-splice@yhbt.net

Send patches (from "git format-patch") with "git send-email" and do not
send HTML email or attachments.  We are very responsive to email and you
will usually get a response within 24-72 hours.

== Mailing List Archives

* https://yhbt.net/ruby-io-splice/
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.io-splice
* nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.io-splice

Anybody may post without a subscription, but HTML mail will
be rejected: mailto:ruby-io-splice@yhbt.net

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
* master       Ruby io_splice 4.4.2 - URL + doc updates (2020-02-22)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
v4.4.2       Ruby io_splice 4.4.2 - URL + doc updates (2020-02-22) tar.gz
v4.4.1       Ruby io_splice 4.4.1 - minor updates (2019-01-02) tar.gz
v4.4.0       Ruby io_splice 4.4.0 - minor updates (2015-01-11) tar.gz
v4.3.0       io_splice 4.3.0 - cleanups and compatibility fixes (2014-02-15) tar.gz
v4.2.0       io_splice 4.2.0 - several bugfixes and workarounds (2013-01-19) tar.gz
v4.1.1       io_splice 4.1.1 - workaround socket -> pipe issues (2011-05-17) tar.gz
v4.1.0       io_splice 4.1.0 - copy_stream enhancement for 1.9 (2011-05-16) tar.gz
v4.0.0       io_splice 4.0.0 - easier to use! (2011-05-12) tar.gz
v3.1.0       io_splice 3.1.0 - IO::Splice.copy_stream improvement (2011-05-01) tar.gz
v3.0.0       io_splice 3.0.0 - kinder, gentler Linux zero-copy (2011-03-01) tar.gz
...

# associated public inboxes:
# (number on the left is used for dev purposes)
            https://yhbt.net/ruby-io-splice

git clone https://yhbt.net/ruby_io_splice.git