Skip to content

Commit 15cab7a

Browse files
committed
Initial C extension with libev 4.04
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.
1 parent f0db164 commit 15cab7a

23 files changed

+7084
-6
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ spec/reports
1515
test/tmp
1616
test/version_tmp
1717
tmp
18+
lib/nio4r_ext.*
19+
ext/**/*.o
20+
ext/**/nio4r_ext.*

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ License
3939
-------
4040

4141
Copyright (c) 2011 Tony Arcieri. Distributed under the MIT License. See
42-
LICENSE.txt for further details.
42+
LICENSE.txt for further details.
43+
44+
Includes libev. Copyright (C)2007-09 Marc Alexander Lehmann. Distributed under
45+
the BSD license. See ext/libev/LICENSE for details.

Rakefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env rake
22
require "bundler/gem_tasks"
3+
require "rake/clean"
34

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

6-
task :default => :spec
7+
task :default => %w(compile spec)
8+
9+
CLEAN.include "**/*.o", "**/*.so", "**/*.bundle"

ext/libev/Changes

+388
Large diffs are not rendered by default.

ext/libev/LICENSE

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
All files in libev are Copyright (C)2007,2008,2009 Marc Alexander Lehmann.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above
11+
copyright notice, this list of conditions and the following
12+
disclaimer in the documentation and/or other materials provided
13+
with the distribution.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
27+
Alternatively, the contents of this package may be used under the terms
28+
of the GNU General Public License ("GPL") version 2 or any later version,
29+
in which case the provisions of the GPL are applicable instead of the
30+
above. If you wish to allow the use of your version of this package only
31+
under the terms of the GPL and not to allow others to use your version of
32+
this file under the BSD license, indicate your decision by deleting the
33+
provisions above and replace them with the notice and other provisions
34+
required by the GPL in this and the other files of this package. If you do
35+
not delete the provisions above, a recipient may use your version of this
36+
file under either the BSD or the GPL.

ext/libev/README

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
libev is a high-performance event loop/event model with lots of features.
2+
(see benchmark at http://libev.schmorp.de/bench.html)
3+
4+
5+
ABOUT
6+
7+
Homepage: http://software.schmorp.de/pkg/libev
8+
Mailinglist: libev@lists.schmorp.de
9+
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
10+
Library Documentation: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
11+
12+
Libev is modelled (very losely) after libevent and the Event perl
13+
module, but is faster, scales better and is more correct, and also more
14+
featureful. And also smaller. Yay.
15+
16+
Some of the specialties of libev not commonly found elsewhere are:
17+
18+
- extensive and detailed, readable documentation (not doxygen garbage).
19+
- fully supports fork, can detect fork in various ways and automatically
20+
re-arms kernel mechanisms that do not support fork.
21+
- highly optimised select, poll, epoll, kqueue and event ports backends.
22+
- filesystem object (path) watching (with optional linux inotify support).
23+
- wallclock-based times (using absolute time, cron-like).
24+
- relative timers/timeouts (handle time jumps).
25+
- fast intra-thread communication between multiple
26+
event loops (with optional fast linux eventfd backend).
27+
- extremely easy to embed.
28+
- very small codebase, no bloated library.
29+
- fully extensible by being able to plug into the event loop,
30+
integrate other event loops, integrate other event loop users.
31+
- very little memory use (small watchers, small event loop data).
32+
- optional C++ interface allowing method and function callbacks
33+
at no extra memory or runtime overhead.
34+
- optional Perl interface with similar characteristics (capable
35+
of running Glib/Gtk2 on libev, interfaces with Net::SNMP and
36+
libadns).
37+
- support for other languages (multiple C++ interfaces, D, Ruby,
38+
Python) available from third-parties.
39+
40+
Examples of programs that embed libev: the EV perl module,
41+
rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the Deliantra MMORPG
42+
server (http://www.deliantra.net/), Rubinius (a next-generation Ruby
43+
VM), the Ebb web server, the Rev event toolkit.
44+
45+
46+
CONTRIBUTORS
47+
48+
libev was written and designed by Marc Lehmann and Emanuele Giaquinta.
49+
50+
The following people sent in patches or made other noteworthy
51+
contributions to the design (for minor patches, see the Changes
52+
file. If I forgot to include you, please shout at me, it was an
53+
accident):
54+
55+
W.C.A. Wijngaards
56+
Christopher Layne
57+
Chris Brody
58+

ext/libev/README.embed

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This file is now included in the main libev documentation, see
2+
3+
http://cvs.schmorp.de/libev/ev.html

0 commit comments

Comments
 (0)