io_splice 4.3.0 - cleanups and compatibility fixes
[ruby_io_splice.git] / README
blob5245cb1ba61a34cd0914b588039a3ea946c31b9f
1 = io_splice - zero-copy pipe I/O for Linux and Ruby
3 The splice family of Linux system calls can transfer data between file
4 descriptors without the need to copy data into userspace.  Instead of a
5 userspace buffer, they rely on an ordinary Unix pipe as a kernel-level
6 buffer.
8 == Features
10 * Efficient zero-copy I/O avoids data copies into userspace,
11   reducing garbage for the Ruby garbage collector as a side effect.
13 * More flexible than sendfile, may be used to enable copies between
14   arbitrary file descriptors (assuming kernel support), not just
15   file-to-socket (or file-to-anything in newer Linux).
17 * Thread-safe blocking operations under Ruby 1.9+, releases GVL
18   if blocking operations are used.
20 * Safely usable with non-blocking I/O frameworks (unlike IO.copy_stream)
21   when combined with the IO::Splice::F_NONBLOCK flag.
23 * Fully-documented library API and
24   {examples}[http://bogomips.org/ruby_io_splice/examples/]
26 * Adds helpful IO#pipe_size and IO#pipe_size= accessor methods for
27   resizing the pipe buffer in Linux 2.6.35 or later.
29 == Install
31 Operating system support for the splice(2), tee(2) and vmsplice(2)
32 system calls is required.  Currently, only Linux 2.6.17 or later with a
33 modern C library (glibc 2.5 or later) support these system calls.  Using
34 the latest stable Linux kernel is *HIGHLY* recommended as there have
35 been numerous bugs in the early releases of these system calls.
37 If you're using a packaged Ruby distribution, make sure you have a C
38 compiler and the matching Ruby development libraries and headers.
40 If you use RubyGems:
42     gem install io_splice
44 Otherwise grab the latest tarball from:
46 http://bogomips.org/ruby_io_splice/files/
48 Unpack it, and run "ruby setup.rb"
50 == Usage
52 Our API matches the C API closely, see the RDoc for full API
53 documentation and the Linux manpages for more details.
55 All of these system calls are fairly new have seen limited usage
56 anywhere, even outside of the Ruby world.
58 If you encounter problems (privilege escalation, memory leaks (in the
59 kernel), poor performance, corrupt data, etc..), try upgrading the Linux
60 kernel to the latest stable version.
62 These system calls have a lot of potential, and will hopefully be
63 standardized and available in non-Linux kernels some day.
65 == Development
67 You can get the latest source via git from the following locations:
69   git://bogomips.org/ruby_io_splice.git
70   git://repo.or.cz/ruby_io_splice.git (mirror)
72 You may browse the code from the web and download the latest snapshot
73 tarballs here:
75 * http://bogomips.org/ruby_io_splice.git (cgit)
76 * http://repo.or.cz/w/ruby_io_splice.git (gitweb)
78 Inline patches (from "git format-patch") to the mailing list are
79 preferred because they allow code review and comments in the reply to
80 the patch.
82 We will adhere to mostly the same conventions for patch submissions as
83 git itself.  See the Documentation/SubmittingPatches document
84 distributed with git on on patch submission guidelines to follow.  Just
85 don't email the git mailing list or maintainer with io_splice patches.
87 == Contact
89 All feedback (bug reports, user/development discussion, patches, pull
90 requests) go to the mailing list: mailto:ruby.io.splice@librelist.org
92 == Mailing List Archives
94 In addition to the rsync-able archives provided by http://librelist.org/, we
95 are also mirrored to
96 {Gmane}[http://gmane.org/info.php?group=gmane.comp.lang.ruby.io-splice.general]
97 and maintain our own mbox mirrors downloadable via HTTP.
99 * nntp://news.gmane.org/gmane.comp.lang.ruby.io-splice.general
100 * http://bogomips.org/ruby_io_splice/archives/