Skip to content

Commit

Permalink
Initial C extension with libev 4.04
Browse files Browse the repository at this point in the history
libev is a portable abstraction for several high performance IO APIs,
including epoll on Linux, kqueue on BSD/OS X, completion ports on
Solaris, and fallback support for poll/select.

This should give other Rubies besides JRuby a similar scalability
profile to Java NIO, since they will be using high performance stateful
system calls.
  • Loading branch information
tarcieri committed Dec 22, 2011
1 parent f0db164 commit 15cab7a
Show file tree
Hide file tree
Showing 23 changed files with 7,084 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ spec/reports
test/tmp
test/version_tmp
tmp
lib/nio4r_ext.*
ext/**/*.o
ext/**/nio4r_ext.*
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ License
-------

Copyright (c) 2011 Tony Arcieri. Distributed under the MIT License. See
LICENSE.txt for further details.
LICENSE.txt for further details.

Includes libev. Copyright (C)2007-09 Marc Alexander Lehmann. Distributed under
the BSD license. See ext/libev/LICENSE for details.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rake/clean"

Dir["tasks/**/*.rake"].each { |task| load task }

task :default => :spec
task :default => %w(compile spec)

CLEAN.include "**/*.o", "**/*.so", "**/*.bundle"
388 changes: 388 additions & 0 deletions ext/libev/Changes

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions ext/libev/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
All files in libev are Copyright (C)2007,2008,2009 Marc Alexander Lehmann.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Alternatively, the contents of this package may be used under the terms
of the GNU General Public License ("GPL") version 2 or any later version,
in which case the provisions of the GPL are applicable instead of the
above. If you wish to allow the use of your version of this package only
under the terms of the GPL and not to allow others to use your version of
this file under the BSD license, indicate your decision by deleting the
provisions above and replace them with the notice and other provisions
required by the GPL in this and the other files of this package. If you do
not delete the provisions above, a recipient may use your version of this
file under either the BSD or the GPL.
58 changes: 58 additions & 0 deletions ext/libev/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
libev is a high-performance event loop/event model with lots of features.
(see benchmark at http://libev.schmorp.de/bench.html)


ABOUT

Homepage: http://software.schmorp.de/pkg/libev
Mailinglist: libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Library Documentation: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod

Libev is modelled (very losely) after libevent and the Event perl
module, but is faster, scales better and is more correct, and also more
featureful. And also smaller. Yay.

Some of the specialties of libev not commonly found elsewhere are:

- extensive and detailed, readable documentation (not doxygen garbage).
- fully supports fork, can detect fork in various ways and automatically
re-arms kernel mechanisms that do not support fork.
- highly optimised select, poll, epoll, kqueue and event ports backends.
- filesystem object (path) watching (with optional linux inotify support).
- wallclock-based times (using absolute time, cron-like).
- relative timers/timeouts (handle time jumps).
- fast intra-thread communication between multiple
event loops (with optional fast linux eventfd backend).
- extremely easy to embed.
- very small codebase, no bloated library.
- fully extensible by being able to plug into the event loop,
integrate other event loops, integrate other event loop users.
- very little memory use (small watchers, small event loop data).
- optional C++ interface allowing method and function callbacks
at no extra memory or runtime overhead.
- optional Perl interface with similar characteristics (capable
of running Glib/Gtk2 on libev, interfaces with Net::SNMP and
libadns).
- support for other languages (multiple C++ interfaces, D, Ruby,
Python) available from third-parties.

Examples of programs that embed libev: the EV perl module,
rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the Deliantra MMORPG
server (http://www.deliantra.net/), Rubinius (a next-generation Ruby
VM), the Ebb web server, the Rev event toolkit.


CONTRIBUTORS

libev was written and designed by Marc Lehmann and Emanuele Giaquinta.

The following people sent in patches or made other noteworthy
contributions to the design (for minor patches, see the Changes
file. If I forgot to include you, please shout at me, it was an
accident):

W.C.A. Wijngaards
Christopher Layne
Chris Brody

3 changes: 3 additions & 0 deletions ext/libev/README.embed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file is now included in the main libev documentation, see

http://cvs.schmorp.de/libev/ev.html
Loading

0 comments on commit 15cab7a

Please sign in to comment.