[ANN] io_splice 2.0.0 - IO::Splice.copy_stream added!

E

Eric Wong

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/
* (e-mail address removed)
* 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).
 
E

Eric Wong

* http://bogomips.org/ruby_io_splice/
* (e-mail address removed)
* 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/
 
E

Eric Wong

Eric Wong said:
* http://bogomips.org/ruby_io_splice/
* (e-mail address removed)
* git://git.bogomips.org/ruby_io_splice.git

Changes:

Oops, I screwed up the Subject: line in the original announcement.

I also just tried this release under Rubinius and it works as of
Rubinius commit db6ea50cacb1b2b246ee445f03ae4ffec3015a07. I
even found a bug in my test cases triggered by Rubinius, but
the actual library works fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top