io_splice RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [ANN] io_splice 2.0.0 - IO::Splice.copy_stream added!
@ 2010-06-05  8:53 Eric Wong
  2010-06-06 20:43 ` [ANN] io_splice 2.0.0 - IO::Splice.copy_stream fixes Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2010-06-05  8:53 UTC (permalink / raw)
  To: ruby.io.splice

The splice family of Linux system calls can transfer data between file
descriptors without the need to copy data into userspace.  Instead of a
userspace buffer, they rely on an ordinary Unix pipe as a kernel-level
buffer.

* http://bogomips.org/ruby_io_splice/
* ruby.io.splice@librelist.com
* git://git.bogomips.org/ruby_io_splice.git

Changes:

There is a new IO::Splice.copy_stream method which is similar to
the IO.copy_stream method in 1.9 core, but uses splice()
internally to avoid copies to userspace in situations where
sendfile() is not possible.

With Linux 2.6.35 (and header files to match), we will also
export the F_GETPIPE_SZ and and F_SETPIPE_SZ constants so
they can be used with fcntl() to resize pipe buffers.

The documentation is also updated to reflect the returned
usefulness of the IO::Splice::F_MOVE constant for FUSE
filesystems under Linux 2.6.35.

I've also relicensed to LGPLv2.1+ (from LGPLv3-only) to allow
bundling with GPLv2-only applications (I'm currently the sole
copyright holder).

-- 
Eric Wong


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ANN] io_splice 2.0.0 - IO::Splice.copy_stream fixes
  2010-06-05  8:53 [ANN] io_splice 2.0.0 - IO::Splice.copy_stream added! Eric Wong
@ 2010-06-06 20:43 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2010-06-06 20:43 UTC (permalink / raw)
  To: ruby.io.splice

* http://bogomips.org/ruby_io_splice/
* ruby.io.splice@librelist.com
* git://git.bogomips.org/ruby_io_splice.git

Changes:

This fixes the issue with our copy_stream where non-pipe
descriptors with the O_NONBLOCK flag set were not handled
correctly.  Like IO.copy_stream in Ruby 1.9, our
IO::Splice.copy_stream will _always_ block until IO is available
(or raise if there are errors).

IO::Splice.copy_stream now closes all file descriptors that were
opened within the method, reducing pressure on the garbage
collector.

There are also new singleton convenience methods:

* IO::Splice.full - blocks and splices the full amount
* IO::Splice.partial - blocks until something is spliceable

They are used internally to implement IO::Splice.copy_stream,
but may also be useful to end users.

Rcov shows 100% test coverage \o/

-- 
Eric Wong


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-06 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-05  8:53 [ANN] io_splice 2.0.0 - IO::Splice.copy_stream added! Eric Wong
2010-06-06 20:43 ` [ANN] io_splice 2.0.0 - IO::Splice.copy_stream fixes Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/ruby_io_splice.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).