simplify examples for 1.0.0 API
[ruby_io_splice.git] / README
blobf89db4c23b7152d1fa5de42286b609e1f306bcca
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   socket-to-file.
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 == Install
28 Operating system support for the splice(2), tee(2) and vmsplice(2)
29 system calls is required.  Currently, only Linux 2.6.17 or later with a
30 modern C library (glibc 2.5 or later) support these system calls.  Using
31 the latest stable Linux kernel is *HIGHLY* recommended as there have
32 been numerous bugs in the early releases of these system calls.
34 If you're using a packaged Ruby distribution, make sure you have a C
35 compiler and the matching Ruby development libraries and headers.
37 If you use RubyGems:
39     gem install io_splice
41 Otherwise grab the latest tarball from:
43 http://bogomips.org/ruby_io_splice/files/
45 Unpack it, and run "ruby setup.rb"
47 == Usage
49 Our API matches the C API closely, see the RDoc for full API
50 documentation and the Linux manpages for more details.
52 All of these system calls are fairly new have seen limited usage
53 anywhere, even outside of the Ruby world.
55 If you encounter problems (privilege escalation, memory leaks (in the
56 kernel), poor performance, corrupt data, etc..), try upgrading the Linux
57 kernel to the latest stable version.
59 These system calls have a lot of potential, and will hopefully be
60 standardized and available in non-Linux kernels some day.
62 == Development
64 You can get the latest source via git from the following locations:
66   git://git.bogomips.org/ruby_io_splice.git
67   git://repo.or.cz/ruby_io_splice.git (mirror)
69 You may browse the code from the web and download the latest snapshot
70 tarballs here:
72 * http://git.bogomips.org/cgit/ruby_io_splice.git (cgit)
73 * http://repo.or.cz/w/ruby_io_splice.git (gitweb)
75 Inline patches (from "git format-patch") to the mailing list are
76 preferred because they allow code review and comments in the reply to
77 the patch.
79 We will adhere to mostly the same conventions for patch submissions as
80 git itself.  See the Documentation/SubmittingPatches document
81 distributed with git on on patch submission guidelines to follow.  Just
82 don't email the git mailing list or maintainer with io_splice patches.
84 == Contact
86 All feedback (bug reports, user/development discussion, patches, pull
87 requests) go to the mailing list: mailto:ruby.io.splice@librelist.com
89 == Mailing List Archives
91 In addition to the rsync-able archives provided by http://librelist.com/, we
92 are also mirrored to
93 {Gmane}[http://gmane.org/info.php?group=gmane.comp.lang.ruby.io-splice.general]
94 and maintain our own mbox mirrors downloadable via HTTP.
96 * nntp://news.gmane.org/gmane.comp.lang.ruby.io-splice.general
97 * http://bogomips.org/ruby_io_splice/archives/