From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.io-splice.general Subject: Re: [RFC] try* interfaces in io_splice 2.2.0.18.g3025 Date: Mon, 28 Feb 2011 01:25:54 +0000 Message-ID: <20110228012554.GA31228@dcvr.yhbt.net> References: <20110228011950.GA31141@dcvr.yhbt.net> <20110228011950.GA31141@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298856367 17738 80.91.229.12 (28 Feb 2011 01:26:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 01:26:07 +0000 (UTC) To: ruby.io.splice@librelist.com Original-X-From: ruby.io.splice@librelist.com Mon Feb 28 02:26:01 2011 Return-path: Envelope-to: gclrig-ruby.io.splice@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: ruby.io.splice@librelist.com Xref: news.gmane.org gmane.comp.lang.ruby.io-splice.general:25 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ptrs8-0005I8-BF for gclrig-ruby.io.splice@m.gmane.org; Mon, 28 Feb 2011 02:26:00 +0100 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 8590E21C4F9 for ; Mon, 28 Feb 2011 01:25:59 +0000 (UTC) Eric Wong 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