Re: [ruby.io.splice] [RFC] try* interfaces in io_splice 2.2.0.18.g3025
- From:
- Eric Wong
- Date:
- 2011-02-28 @ 01:25
Eric Wong <normalperson@yhbt.net> wrote:
> There is no IO.tryvmsplice, I haven't figured out if IO.vmsplice is
> useful or not and non-blocking I/O with iovecs is so painful to deal
> with it's not worth it.
Just pushed this out, too:
diff --git a/ext/io_splice/io_splice_ext.c b/ext/io_splice/io_splice_ext.c
index dc1e74d..a0ba381 100644
--- a/ext/io_splice/io_splice_ext.c
+++ b/ext/io_splice/io_splice_ext.c
@@ -394,7 +394,14 @@ static void advance_vmsplice_args(struct
vmsplice_args *a, long n)
* +fd+ must be the writable end of a pipe.
*
* This may allow the kernel to avoid data copies in some cases.
- * but is (probably) of limited usefulness in Ruby.
+ * but is (probably) of limited usefulness in Ruby. If you have
+ * use cases or ideas for making this more useful for Ruby users,
+ * please tell us at ruby.io.splice@librelist.com!
+ *
+ * Also consider the "sendfile" RubyGem or IO.copy_stream in Ruby 1.9
+ * if you want to do zero-copy file transfers to pipes or sockets. As
+ * of Linux 2.6.33, sendfile(2) can copy to any output descriptor,
+ * not just sockets.
*
* See manpage for full documentation:
* http://kernel.org/doc/man-pages/online/pages/man2/vmsplice.2.html
--
Eric Wong