io_splice 4.2.0 - several bugfixes and workarounds
[ruby_io_splice.git] / README
blob6300ac68da0a87180706316c9ea62d94d122eb3d
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 * Almost drop-in replacement for IO.copy_stream: IO::Splice.copy_stream
22 * Safely usable with non-blocking I/O frameworks (unlike IO.copy_stream)
23   when combined with the IO::Splice::F_NONBLOCK flag.
25 * Fully-documented library API and
26   {examples}[http://bogomips.org/ruby_io_splice/examples/]
28 * Adds helpful IO#pipe_size and IO#pipe_size= accessor methods for
29   resizing the pipe buffer in Linux 2.6.35 or later.
31 == Install
33 Operating system support for the splice(2), tee(2) and vmsplice(2)
34 system calls is required.  Currently, only Linux 2.6.17 or later with a
35 modern C library (glibc 2.5 or later) support these system calls.  Using
36 the latest stable Linux kernel is *HIGHLY* recommended as there have
37 been numerous bugs in the early releases of these system calls.
39 If you're using a packaged Ruby distribution, make sure you have a C
40 compiler and the matching Ruby development libraries and headers.
42 If you use RubyGems:
44     gem install io_splice
46 Otherwise grab the latest tarball from:
48 http://bogomips.org/ruby_io_splice/files/
50 Unpack it, and run "ruby setup.rb"
52 == Usage
54 Our API matches the C API closely, see the RDoc for full API
55 documentation and the Linux manpages for more details.
57 All of these system calls are fairly new have seen limited usage
58 anywhere, even outside of the Ruby world.
60 If you encounter problems (privilege escalation, memory leaks (in the
61 kernel), poor performance, corrupt data, etc..), try upgrading the Linux
62 kernel to the latest stable version.
64 These system calls have a lot of potential, and will hopefully be
65 standardized and available in non-Linux kernels some day.
67 == Development
69 You can get the latest source via git from the following locations:
71   git://bogomips.org/ruby_io_splice.git
72   git://repo.or.cz/ruby_io_splice.git (mirror)
74 You may browse the code from the web and download the latest snapshot
75 tarballs here:
77 * http://bogomips.org/ruby_io_splice.git (cgit)
78 * http://repo.or.cz/w/ruby_io_splice.git (gitweb)
80 Inline patches (from "git format-patch") to the mailing list are
81 preferred because they allow code review and comments in the reply to
82 the patch.
84 We will adhere to mostly the same conventions for patch submissions as
85 git itself.  See the Documentation/SubmittingPatches document
86 distributed with git on on patch submission guidelines to follow.  Just
87 don't email the git mailing list or maintainer with io_splice patches.
89 == Contact
91 All feedback (bug reports, user/development discussion, patches, pull
92 requests) go to the mailing list: mailto:ruby.io.splice@librelist.org
94 == Mailing List Archives
96 In addition to the rsync-able archives provided by http://librelist.org/, we
97 are also mirrored to
98 {Gmane}[http://gmane.org/info.php?group=gmane.comp.lang.ruby.io-splice.general]
99 and maintain our own mbox mirrors downloadable via HTTP.
101 * nntp://news.gmane.org/gmane.comp.lang.ruby.io-splice.general
102 * http://bogomips.org/ruby_io_splice/archives/