ChangeLog from http://bogomips.org/sleepy_penguin.git commit 6ea1667ab4f5e96e3f761493a8c82a844aa4922b Author: Eric Wong Date: Mon Dec 30 01:22:58 2013 +0000 sleepy_penguin 3.3.0 - fixes and compatibility improvements Most notably, this fixes memory leaks for any users of inotify reads, epoll/kevent waiting using short-lived thread. Users of long-lived threads for these functions (all Rainbows!, yahns, and zbatery users) are not affected. A fair amount of internal cleanup was necessary for this. Compatibility with non-Linux systems without clock_gettime is improved, thanks to Lin Jen-Shin. Note: the kevent code is not at all optimized and still uses RARRAY_PTR, so it likely sucks under rbx and MRI 2.1. Eric Wong (13): test_epoll: minor compatibility fix for Ruby 2.1.0 avoid RARRAY_PTR usage for Linux-only bits init: avoid redefinition warning for _GNU_SOURCE Rakefile: kill raa_update task util: minor cleanup to favor rb_io_get_io tests: switch to minitest test_epoll: switch test_dup_and_fork to exit! remove all signalfd-related files tests: remove version-dependent FD_CLOEXEC checks work around lack of rb_io_get_io in Rubinius value2timespec: use StringValueCStr for correctness refactor and fix leak from thread-local storage use extconf: avoid unnecessary linkage against libkqueue Lin Jen-Shin (1): Support for broken system without clock_gettime. commit 117a81eddb1375dd1d08d7e7b57c585354dd2d90 Author: Eric Wong Date: Fri Dec 27 23:09:24 2013 +0000 extconf: avoid unnecessary linkage against libkqueue The check for libkqueue may succeed out-of-the-box on Debian systems where libkqueue-dev is installed. However, libkqueue-dev on Debian installs sys/event.h in a non-standard include path (/usr/include/kqueue), so it is not picked up by default and kqueue support is never compiled. So only check for (and link to) libkqueue if we are configured to detect sys/event.h. This should not affect users on *BSD platforms with native kqueue support. commit 45ce6646ab7cc62ad30ec0bf9c68719f9c467866 Author: Eric Wong Date: Fri Dec 27 23:02:48 2013 +0000 refactor and fix leak from thread-local storage use Storing heap-allocated memory in __thread is not feasible for a library since it provides no automatic resource de-allocation. This oversight caused rare applications which use short-lived threads for epoll_wait, kevent, or inotify read to leak memory over time. So we refactor everything to use pthread_* thread-local storage APIs instead. While we're at it, we can safely use a common, generic buffer for inotify, epoll, and kevent to avoid running into PTHREAD_KEYS_MAX limitations. These leaks only affected sleepy_penguin v3.2.0 and later, and only applications which use short-lived threads to call epoll_wait, kevent and inotify read. commit a00b3766fa4c498a65f5742e161a382717db3041 Author: Eric Wong Date: Thu Nov 21 18:29:25 2013 +0000 value2timespec: use StringValueCStr for correctness rb_inspect is unlikely to put a \0 byte in the middle of a string, but use StringValueCStr anyways just in case to catch potential bugs. commit 25e4c572eb30e2caae6528ef4f2b784fe5540aff Author: Eric Wong Date: Thu Nov 21 18:24:46 2013 +0000 work around lack of rb_io_get_io in Rubinius https://github.com/rubinius/rubinius/issues/2771 commit 099f4464e034e76d46493dae8fc211fdd93c9127 Author: Eric Wong Date: Sat Oct 19 11:56:57 2013 +0000 tests: remove version-dependent FD_CLOEXEC checks Not all versions/implementations of Ruby set FD_CLOEXEC by default. And it is conceivable MRI will disable the current FD_CLOEXEC default out of portability concerns, so we only test that our code matches. commit 620b6c13a00225d8f154bba875b710df15a64311 Author: Eric Wong Date: Sat Oct 19 11:17:03 2013 +0000 remove all signalfd-related files They're long disabled, and there's no way for them to work sanely inside any VM/language which supports signal handlers. There's little need, even, as Ruby has a good API for signal handlers and we have eventfd support. commit 50763e8a3f5fac33e456c459e187f6a9b1c91fe3 Author: Eric Wong Date: Sat Oct 19 08:42:56 2013 +0000 test_epoll: switch test_dup_and_fork to exit! exit! is preferable for forked processes in tests since exit may fire at_exit handlers for tests depending on which test suite or version of Ruby is loaded. This was problematic in minitest 5.0.8 but not 4.3.2 commit 18f96b1a5386dec0dc9b5f14c64c7de8b4230ca2 Author: Eric Wong Date: Sat Oct 19 07:21:41 2013 +0000 tests: switch to minitest Add a compatibility shim in test/helper to avoid noisy warnings with Minitest (out-of-the-box on Ruby 2.0.0) and also Minitest 5. Automated conversion via: perl -i -p -e 's,test/unit,./test/helper,g' test/test_*.rb perl -i -p -e 's,Test::Unit::TestCase,Testcase,g' test/test_*.rb Yes, I prefer Perl for one-liners :P commit 782dba32b5534ffaa5727a762a4c628bdac32331 Author: Eric Wong Date: Sat Oct 19 07:16:22 2013 +0000 util: minor cleanup to favor rb_io_get_io This makes our code slightly smaller on Ruby 1.9+ commit 23447e63e64753223768d8481eb3c98f1c933bdf Author: Eric Wong Date: Mon Sep 30 18:21:30 2013 +0000 Rakefile: kill raa_update task RAA is dead commit 81b0e8e247746ed9c30fb4dc8e911b38eedd38bc Author: Eric Wong Date: Thu Sep 26 21:37:12 2013 +0000 init: avoid redefinition warning for _GNU_SOURCE This is already defined for most (if not all) Rubies when ruby.h is included. commit cda98c580e7fdc12f996d29436a13b282affc92e Author: Eric Wong Date: Thu Sep 26 21:32:44 2013 +0000 avoid RARRAY_PTR usage for Linux-only bits RARRAY_PTR incurs extra overhead on the Ruby 2.1.0 and Rubinius GC implementations, so avoid it. None of these are believed to be performance-critical enough to benefit from RARRAY_PTR in older Rubies, either. commit 5deb65e7274a4187033a60c6c859fd92ccfce88e Author: Eric Wong Date: Thu Sep 26 21:31:27 2013 +0000 test_epoll: minor compatibility fix for Ruby 2.1.0 Ruby 2.1.0 raises a subclass of Errno::EINPROGRESS, which fails the exact matching of assert_raises. This does not affect any known real code. commit df5628fee6d8f6c854302d90db5c35ba8dea83c7 Author: Lin Jen-Shin Date: Tue Sep 24 16:55:47 2013 +0800 Support for broken system without clock_gettime. Fallback mechanism was copied from clogger: http://clogger.rubyforge.org/ This would also make sleepy_penguin compiles on Mac OS X, which is lacking clock_gettime. All tests passed for me. [ew: fixed indentation Note: this project does not and will never officially support non-Free OSes, but there are likely other systems without clock_gettime but has kqueue (perhaps via libkqueue).] Signed-off-by: Eric Wong commit f039e80b90260f7c4a831806ddc4d22fc9d27eb4 Author: Eric Wong Date: Tue Jul 16 18:09:51 2013 +0000 sleepy_penguin 3.2.0 - minor bug fixes, preliminary kqueue support epoll support and thread-safety improvements. The dangerous Epoll::IO interface is now an option for those who want to share an epoll descriptor across fork and maintain their own IO object references to avoid extra overhead. Use the regular (high-level) Epoll interface unless you're willing to shoot yourself in the face. There is also preliminary Kqueue support (which should work under libkqueue on Linux). Similar to our epoll interface (and unlike most event libraries/frameworks) our kqueue interface also supports one-shot notifications and _embraces_ multi-threaded use. Note: unlike epoll, kqueue has close-on-fork behavior, so kqueue descriptors are not (ever) inheritable across fork. Added EPOLLWAKEUP constant (Linux 3.5 + glibc 2.17 required) to allow descriptors to prevent system suspend while active (this requires the CAP_BLOCK_SUSPEND privilege). Inotify and Epoll interfaces now use thread-local buffers for thread-safety and improved concurrency without GVL. Errno::EINTR is no longer propagated into Ruby-land, for consistency with existing Ruby IO APIs. commit 1694820af3bb917556404f61a1a1e19e845bc181 Author: Eric Wong Date: Fri May 3 18:55:31 2013 +0000 pkg: include generated version header in distribution Oops, the lack of this header prevented gems from being built + installed properly. commit aa4958b713e3979af863410f410d2529fe6764c2 Author: Eric Wong Date: Wed May 8 22:07:43 2013 +0000 test_epoll_io: ensure subclassing Epoll::IO works A subclass may want to set CLOEXEC by default. commit 5a757f1515d4131ad4f6f1203dd6a117a9005d4f Author: Eric Wong Date: Fri May 3 18:45:06 2013 +0000 auto-generate SLEEPY_PENGUIN_VERSION constant This allows the Ruby-visible constant to always be up-to-date with the release. commit a64016a9c6e80302da46b46b96fa2f3765ea5591 Author: Eric Wong Date: Thu May 2 23:00:03 2013 +0000 README: update with latest features We support kqueue and Rubinius. Nowadays, we also export the potentially dangerous low-level APIs for epoll and kqueue. commit 565b92da156ddf268634c3e1076d51d811ff0dc6 Author: Eric Wong Date: Fri May 3 01:18:43 2013 +0000 test_kqueue_io: additional test for IO-likeness We need to ensure Kqueue::IO remains IO-like commit 33985d31bd01b32f6264ec7d87f40dcbb0c924be Author: Eric Wong Date: Fri May 3 01:12:14 2013 +0000 kqueue: remove timeout handling for nevents==0 The underlying kevent() itself already bypasses the timeout if nevents==0 (so it is impossible to emulate a sleep function with kevent()). commit 1ba2600636f9080792408e134acc4c8f226d0930 Author: Eric Wong Date: Fri May 3 00:53:01 2013 +0000 doc: flesh out kqueue-related documentation Hopefully this will lead to less confusion among new users. commit 6b2c95c50a241fa7bd362a6022dedfdc5921db9f Author: Eric Wong Date: Thu May 2 03:00:05 2013 +0000 do not propagate Errno::EINTR into Ruby To be consistent with I/O wrappers in Ruby, Ruby-land should never see EINTR from kevent or epoll_wait. We will just return zero events if our timeout expired soon after we got signaled. commit 05448f74a80b631410f0c39ea4b333d26acec074 Author: Eric Wong Date: Tue Apr 30 02:24:19 2013 +0000 test_epoll: workaround race condition in test_close Wait longer before killing the epoll_wait thread, as we may not have entered epoll_wait inside that thread before we send Thread#kill to it. This caused intermittent IOError as the thread delected the Epoll::IO object was already closed, before the snapshot (to prevent GC) could be made. commit c1fdf07413364407d148fb588cd1c2ba1fe7f677 Author: Eric Wong Date: Tue Apr 30 02:05:22 2013 +0000 epoll: clear FD marks snapshot before returning This allows the heap to reclaim memory sooner (than waiting for GC), lowering memory usage and perhaps speeding up future allocations. commit d5e6ab56efd5a3c538c8f31b120c0dff6dbcf38a Author: Eric Wong Date: Tue Apr 30 01:49:52 2013 +0000 test_epoll: increase delay between signal spamming Frequently sending signals can lead to high memory usage and slowdowns on some Ruby + malloc implementations. commit b7221617908d5cd73da17c11beb7ef96b12e7fa5 Author: Eric Wong Date: Tue Apr 30 00:02:01 2013 +0000 test_epoll: join thread before return from test We want to avoid closing the descriptor while the thread is running. commit da07e5676040d543c33720efae19f2a70e766a39 Author: Eric Wong Date: Mon Apr 29 20:55:10 2013 +0000 kqueue: workaround lack of RSTRUCT* macros on Rubinius Rubinius will not support RSTRUCT* macros, so converting the structs to arrays is the least intrusive way to go about our code. ref: https://github.com/rubinius/rubinius/issues/494 commit a974d3acb4cf59696c71f82004e2b42d1c1903d9 Author: normalperson@yhbt.net Date: Mon Apr 29 20:07:52 2013 +0000 kqueue/io: fix MRI 1.8 support code for event retrieval First off, the timeout is not handled properly when timing out, resulting in an infinite loop. Secondly, arguments were not passed to the yielded block correctly. Finally, the return value of kevent was not returned correctly to the caller. commit dbcc2af6f5ec958fb71d96d20ebdcd7860be8274 Author: normalperson@yhbt.net Date: Mon Apr 29 20:06:59 2013 +0000 test_kqueue: only test if IO#autoclose= exists The high-level kqueue class is not usable without IO#autoclose commit cd946812abada277c9c8b85d9165748ef066abbf Author: normalperson@yhbt.net Date: Mon Apr 29 19:52:37 2013 +0000 test_kqueue_io: join thread in test when done using Due to strange scheduling, the ensure clause could fire while the thread was still inside wr.syswrite even though the main thread received the event and exited the method. commit c04b173f52c362c64899bd7b2942cab0658e1cee Author: Eric Wong Date: Mon Apr 29 19:36:40 2013 +0000 test_epoll: workaround MRI 1.8 threading bug Threads do not seem safe to start inside signal handlers on Matz Ruby 1.8 commit 98af77f834ca0a821a091085a3fdc5e645f704fc Author: Eric Wong Date: Mon Apr 29 19:30:25 2013 +0000 kqueue: set zero timeout if not retrieving events Having a timeout does not make sense if not retrieving events, so avoid potentially triggering bugs or strange behavior between different kqueue implementations. commit d0f40416ce43a9148a4a2f397f6bc606a39688b2 Author: Eric Wong Date: Mon Apr 29 19:11:42 2013 +0000 test_timerfd: relax timing-sensitive test This test failed on overloaded systems (and may still fail) Unfortunately timers are hard to test as system latency must be taken into account. commit bb70a4e003997e6eceea0d03cd941a46ec165f82 Author: Eric Wong Date: Mon Apr 29 19:00:39 2013 +0000 test_kqueue_io: test for multiple event return This is not _my_ common use case, but some people may want to fetch multiple events at once. commit 8575d11394a84cef2a8a8bddb21ec79e8a841a59 Author: Eric Wong Date: Mon Apr 29 18:59:48 2013 +0000 test_kqueue: join thread after test It's good to cleanup after ourselves. commit 047f284170072de8d8caf0fb6e79019eb453b58a Author: Eric Wong Date: Fri Apr 26 20:30:56 2013 +0000 fork-safe "to_io" in high-level epoll/kqueue We need to validate the underlying IO object before using it in a forked child. commit 6b631c291e7220daad2954a129153de774a76572 Author: Eric Wong Date: Fri Apr 26 20:02:11 2013 +0000 test_epoll: avoid sleeping inside a signal handler It's generally unsafe to sleep inside a signal handler, and seems to cause intermittent test failures. commit d1b31d49b2c376ce3c7691b5037d5edea517fb09 Author: Eric Wong Date: Thu Apr 25 18:36:54 2013 +0000 test: remove Rubinius-specific checks and skips These skips no longer seem needed. Removed the GC tests since they were unreliable (even on MRI), anyways. commit ba9848c3ce97e7d0e494fccfccc94c778c7d5188 Author: Eric Wong Date: Thu Apr 25 08:17:11 2013 +0000 test_epoll: remove assert_nothing_raised assert_nothing_raised hides backtraces on real errors, so we'll stop doing it, now. commit f7cb886cfde08a5217d0d4370285e2b5cabd481f Author: Eric Wong Date: Thu Apr 25 04:03:48 2013 +0000 preliminary kqueue support This is still a work-in-progress, but allows us to support using a kqueue descriptor from multiple threads. (e.g. one thread waiting with kevent, while another thread modifies the watch list via kevent) commit b57b0fa2bda6c755d366df0dc0579e244fb167a8 Author: Eric Wong Date: Wed Apr 24 20:10:15 2013 +0000 pkg.mk: allow passing arguments to extconf This allows us to use something like: make build EXTCONF_ARGS='--with-kqueue-include=/usr/include/kqueue \ --with-kqueue-libs=-lkqueue' To build with libkqueue. commit 07871a12535da6cd58abf58f8a3f8dca3dffbb6e Author: normalperson@yhbt.net Date: Tue Apr 23 22:53:36 2013 +0000 allow building without epoll (or inotify) support We will support kqueue on FreeBSD-based systems. commit 7181b7e4da11894b59caebc1c864deca06a780b2 Author: Eric Wong Date: Sun Apr 21 03:48:27 2013 +0000 epoll: enforce maxevents > 0 before memory allocation This prevents overflow and excessive memory usage/OOM error. Note: the kernel enforces this and returns EINVAL anyways, we just do it to prevent OOM here. commit 623c6797bcf1f8077c39cdcffb83b9aa25793932 Author: Eric Wong Date: Sun Apr 21 03:00:20 2013 +0000 favor comparison against 0 for error checking When possible, comparisons against zero require one less load and uses one less register, so this results in smaller code: $ ~/linux/scripts/bloat-o-meter before.so after.so add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-57 (-57) function old new delta rm_watch 84 83 -1 rb_sp_set_nonblock 80 79 -1 add_watch 127 126 -1 epwait 692 687 -5 s_new 970 921 -49 This style is favored by major C projects, including glibc. Note: since file and file descriptor flags may eventually use more bits of an integer, we continue comparing F_GETFD/F_GETFL return values against -1 to be future proof. commit 92b55d65af197218b7653018847b14141cd393de Author: Eric Wong Date: Sat Apr 13 11:29:33 2013 +0000 set close-on-exec by default under Ruby 2.0 Ruby 2.0 creates file descriptors with the close-on-exec flag specified by default. Unless a user specifies flags explicitly, assume the default is to set the close-on-exec. This does not change behavior of Ruby 1.9 and earlier. commit 856e3e6706a9ab40047eff22f0ddc9dd40ecdde2 Author: Eric Wong Date: Sat Apr 13 11:06:39 2013 +0000 extconf: remove pthread checks We no longer need to use pthread_* functionality. commit 14141d20e359cc038424fc3d04151df6d5f9de2e Author: Eric Wong Date: Sat Apr 13 09:21:00 2013 +0000 README: update description Ruby 2.0 is out and we're compatible. Also, we've always supported EPOLLONESHOT, promote it. commit 0337144dc569a8795e562cac4d6071e29c1526ac Author: Eric Wong Date: Sat Apr 13 01:14:38 2013 +0000 doc: rdoc fixes and cleanups Our usage of rdoc was incorrect in some places and causing internal methods to become visible. commit 3d8e66dfec175de1f402ef9b77c018c6d437fca1 Author: Eric Wong Date: Sat Apr 13 01:07:05 2013 +0000 .wrongdoc: add public/private email addresses This was forgotten for some reason, no longer. commit 78450556becf67a3eb8b0870b38b2c75d99ad96e Author: Eric Wong Date: Fri Apr 12 23:54:13 2013 +0000 epoll: cleanup GVL-release code for Ruby 2.0.0 rb_thread_blocking_region is deprecated in Ruby 2.0, but rb_thread_io_blocking region is not (and superior for I/O). So we will favor rb_thread_io_blocking_region for now. While we're at it, reimplement green-thread-safe (Ruby 1.8) epoll_wait in Ruby instead of C. The extra #ifdefs for 1.8.7 were more prone to bitrot and Ruby code should be easier to follow for Rubyists who care about 1.8. commit 4c4a6ae523bc7bac4be0fd4dc104b055161ad260 Author: Eric Wong Date: Fri Apr 12 02:05:54 2013 +0000 inotify: thread-safe Inotify#take for rbx Rubinius provides a Rubinius.synchronize helper for locking objects which do not otherwise have locks. We need to synchronize Inotify#take access to prevent the internal array from being clobbered. This avoids unnecessary locking overhead on MRI which maintains a GVL. commit 26ba5806ddf9bce97c55f40c741da7d2e29aafbc Author: Eric Wong Date: Fri Apr 12 02:05:53 2013 +0000 inotify: use thread-local internal buffer This gives us thread-safety for the internal buffer. While we're at it, cache-align this buffer to avoid unnecessary overhead when read() writes to it. commit 1fdbe4e5e1e46eedf11dbf765bf228bd1a831d09 Author: Eric Wong Date: Fri Apr 12 20:21:46 2013 +0000 license + gem packaging cleanups require_paths and date are automatically set in modern RubyGems versions. Since we only use modern RubyGems versions, the licenses= accessor is also activated. Since the FSF may change mailing addresses again in the future, prefer the web address to point to licenses. This change is acceptable for GNU projects, so it should be for us, too: http://sourceware.org/bugzilla/show_bug.cgi?id=13673 commit ee7efd4c7b8f1fc10b239e80f3296d943c05e04e Author: Eric Wong Date: Fri Apr 12 19:57:47 2013 +0000 .gitignore: add .rbx Rubinius drops this directory on us nowadays commit 486cafa9da2dcaf988d9ecdf1b407c7e876a0217 Author: Eric Wong Date: Fri Apr 12 22:18:59 2013 +0000 test_epoll_gc: force GC on EMFILE/ENFILE This helps avoid test errors on Rubinius where rb_gc() is a noop. Otherwise, we might as well infinite loop on thread-creation to trigger GC. commit d4b5c8d7c1abe673915aca8674c5e0b55a0aaffa Author: Eric Wong Date: Thu Apr 11 04:17:35 2013 +0000 avoid ENOMEM checking in common code paths ENOMEM from syscalls such as inotify_add_watch and epoll_ctl are from the lack of kernel memory, so even a successful rb_gc() is unlikely to be able to reap memory taken from those slab caches. commit 49cb42a42022dffd98fc5b3acdb2dfc7bf5bd156 Author: Eric Wong Date: Thu Apr 11 04:17:34 2013 +0000 epoll: cache alignment for per-thread structure This probably won't make a huge difference in Ruby, but perhaps one day the unnecessary dirtying of cache lines will affect performance (and we'll be ready when that day comes). While we're at it, remove usage of pthread* functions for thread-local variables. The __thread construct from GCC (and also implemented by clang) is much easier-to-use than the pthread_*specific API. commit 8f5d890d80d8201681941c61870162b55878933b Author: Eric Wong Date: Thu Apr 11 03:38:29 2013 +0000 epoll: implement thread-safety for mark/flag arrays Concurrent modification of Arrays is thread-unsafe and must be protected by a Mutex. eventpoll objects inside the Linux kernel are similarly protected by a (kernel) mutex, and do not need additional locking. However, we lock around epoll_ctl here anyways since we must modify our userland arrays after we modify the kernel structure. We must modify userland arrays after the kernel structure to prevent epoll_wait callers from seeing an unreferenced object. commit 83b903d3ffc99f0377fee8d051fe23f475591546 Author: Eric Wong Date: Thu Apr 11 02:58:51 2013 +0000 split Epoll and Epoll::IO, rewrite Epoll in Ruby Epoll::IO is a dangerous, low-level class which is intended for users aware of the GC and fork behavior of epoll in the Linux kernel. Rewriting the higher-level Epoll in Ruby makes it easier to maintain, especially since Rubinius has no GVL while running C extensions. commit 5bfc2dd29748c559e833ff654b5210067a1d9e91 Author: Eric Wong Date: Sat Apr 6 00:21:34 2013 +0000 test_epoll: synchronize writes to the pipe array Concurrent modification of the array is not thread-safe. commit 0f55aa0caa4846aab8e3a8df85fdea884a317a01 Author: Eric Wong Date: Sat Apr 6 00:21:00 2013 +0000 test_epoll: fix timing error in test We need to record the time before the thread is spawned for correct timing commit 446033931a8051656585bacd6277e9823a3e62e8 Author: Eric Wong Date: Wed Apr 3 00:28:01 2013 +0000 util: comment explaining non-use of FIONBIO I was about to change this to the FIONBIO here myself before I realized we do not frequently _change_ file flags. commit 2f5c82c26aeaf3536deace3521097d3e9eaefc20 Author: Eric Wong Date: Fri Mar 1 19:50:27 2013 +0000 reload FD after rb_io_wait_*able functions The file descriptor may be closed while GVL is released, so we must reload the descriptor before and after calling rb_io_wait_*able functions. We reload before calling rb_io_wait_*able because the GVL was released for the function call (read/write) which triggered EAGAIN. We reload after calling rb_io_wait_*able because rb_io_wait_*able releases the GVL, too. commit c217412e59dedf0fa98069815c395339007ede6b Author: Eric Wong Date: Thu Jan 24 00:45:59 2013 +0000 epoll: update documentation for multi-threaded use We forgot to update this documentation when we released 3.1.0 commit 34bcf72e526bba8470e4494b1c7d5fd055e7a1ed Author: Eric Wong Date: Wed Jan 23 19:43:36 2013 +0000 epoll: use pthread_once properly pthread_once_t must be static to be effective. This bug only affects apps which load sleepy_penguin multiple times. commit 9449295d3e6109fb5516a1aa2e6735e2a043a7ab Author: Eric Wong Date: Thu Jan 17 21:40:26 2013 +0000 epoll: add EPOLLWAKEUP constant This was added in Linux 3.5 and glibc 2.17 commit b3fa14976bc41c2daad0b8a6afd74a8212dcb97b Author: Eric Wong Date: Thu Jan 17 21:30:30 2013 +0000 Revert "epoll: avoid EPOLL_CTL_MOD race condition" This reverts commit 02e5a91b24983d96b342c007661966495ccdb619. This workaround may have unintended side-effects for apps using EPOLL_CTL_DEL. commit 02e5a91b24983d96b342c007661966495ccdb619 Author: Eric Wong Date: Thu Jan 3 03:52:31 2013 +0000 epoll: avoid EPOLL_CTL_MOD race condition Until everybody updates to a version of the Linux kernel with this fix, we need to enable a workaround for older kernels using EPOLL_CTL_DEL + EPOLL_CTL_ADD to emulate EPOLL_CTL_MOD behavior. This race condition is fixed in Linux upstream commit 128dd1759d96ad36c379240f8b9463e8acfd37a1 and included in Linux v3.8-rc2 and later. This fix will likely be backported to stable and vendor kernels, so we'll whitelist them as we learn of them. commit db1eb67855149050e448c63df12ade22135916cd Author: Eric Wong Date: Wed May 2 08:56:22 2012 +0000 sleepy_penguin 3.1.0 - minor fixes and features * add TimerFD::CANCEL_ON_SET constant ref: http://www.man7.org/tlpi/api_changes/ * fix concurrent Epoll#wait on the same epoll fd * SignalFD interface removed (unworkable with Ruby runtimes) * use rb_update_max_fd() if available (Ruby 1.9.3) * reintroduce SLEEPY_PENGUIN_VERSION constant ("3.1.0") commit 455bd1f97e978d337764e2c917353889c3fa4d9c Author: Eric Wong Date: Wed May 2 08:52:03 2012 +0000 reintroduce SLEEPY_PENGUIN_VERSION constant We unfortunately need it since we switched to the per-thread epoll_wait structures. commit 1264e45ee8776e68df08e76a75d08fa745266e22 Author: Eric Wong Date: Wed May 2 08:24:52 2012 +0000 timerfd: remove unusable constants (never released) timerfd currently (Linux 3.3.x) only supports CLOCK_REALTIME and CLOCK_MONOTONIC, and not every single clock supported by POSIX clocks. commit e2a9b831ec9ab2c8fad622deec1aef8853f4cb41 Author: Eric Wong Date: Sun Apr 22 08:13:46 2012 +0000 epoll: update comment on free(NULL) usage It's POSIX, and since epoll is Linux-only and Linux uses glibc which is pretty up-to-date w.r.t POSIX, we don't have to worry... commit b6982e360e00adc2a15c6d75dc6a5cde56cd9e7f Author: Eric Wong Date: Sat Dec 10 20:50:41 2011 +0000 teset: epoll used as a queue This is a testcase I wrote a few months ago commit 6fa0bc3f4c6fd959463a3906a820a724076a416c Author: Eric Wong Date: Thu Mar 22 08:29:13 2012 +0000 epoll: use per-thread data structure for concurrent Epoll#wait This allows multiple threads to park on Epoll#wait (without holding onto the GVL). This allows a single, one-shot notification to wake up a single thread (another notification to a different IO object would wake up another thread). This allows using the same multi-threaded, EPOLLONESHOT-based design as cmogstored: http://bogomips.org/cmogstored/queues.txt commit ec3be1488e53036a9a502fbb670ea584c41d5ade Author: Eric Wong Date: Thu Mar 22 08:27:31 2012 +0000 test_epoll: disable expensive test without STRESS Tests run a lot faster, now, and this isn't functionality we have to worry about often now that I better understand MRI internals. commit e38bb616f8dc15ba3cf082388aca75ac449645e6 Author: Eric Wong Date: Thu Mar 22 08:24:59 2012 +0000 sleepy_penguin.h: add prototype for rb_thread_io_blocking_region This function is exposed in the libruby-static archive for Ruby 1.9.3, but there is no publically-declared prototype for it. commit c72bc3f27b1ea65baa36eba3d24a32a1b9647ac1 Author: Eric Wong Date: Wed Mar 7 09:21:45 2012 +0000 epoll: split out ugly green thread code It's ugly and confusing to look at, so split it out. commit c309a1eca250ae55f454f5cbe9248191d7ff0e82 Author: Eric Wong Date: Thu Feb 23 08:15:21 2012 +0000 test: new testcase for edge-triggered accept Found uncommited in my working directory, I can't remember when/where I wanted to test this, but we might as well for documentation purposes... commit ef6beed6ae65e1d66e7a23a61aadee68a65d9757 Author: Eric Wong Date: Tue Jul 26 17:20:10 2011 -0700 use sleepy.penguin@librelist.org address instead of .com Neither we nor librelist are commercial projects, so use the TLD preferred for non-profit entities. commit c77c7e4cf7f2850d7163db3fcbed5a0ef829edb9 Author: Eric Wong Date: Tue Jul 26 17:11:43 2011 -0700 disable SignalFD interface It's a waste of memory to have something that has no chance of working reliably with any existing Ruby runtimes. commit 73732a743e90cb40336946168619e0d328f7e213 Author: Eric Wong Date: Tue Jul 26 17:07:27 2011 -0700 rb_update_max_fd() support for epoll This is the only descriptor we manage ourselves and don't use IO.for_fd with (epoll is quite "special" wrt fork). commit 39a80da93d03c30b4e39e9363e0233a891c83935 Author: Eric Wong Date: Thu Jun 16 07:45:40 2011 +0000 fix unused variable warnings Oops... commit e71c6f4f4a79ae6d21a0da1a767af2ed168df0f3 Author: Eric Wong Date: Wed Jun 15 16:36:56 2011 -0700 timerfd: add new constants from 2.6.39 and 3.0 We still need to document these. ref: http://www.man7.org/tlpi/api_changes/ commit c4e6fa6fed7213ca4f7ac270b56bfd4c044c7b91 Author: Eric Wong Date: Wed Jun 8 17:00:42 2011 -0700 test_epoll: add level trigger test Just to ensure we still work with level triggered usage. commit ee4481de83bb8d208ff99aed9b5fff393115114c Author: Eric Wong Date: Fri May 20 19:39:58 2011 -0700 sleepy_penguin 3.0.1 - really avoids EINTR One bugfix: * epoll: avoid race condition in EINTR checking Even if we timeout while getting an EINTR, we'll retry epoll_wait() with a zero timeout like IO.select does in Ruby to avoid raising Errno::EINTR. commit 2fb791b331b286f2af86d807028818d493f0f556 Author: Eric Wong Date: Fri May 20 19:34:39 2011 -0700 epoll: avoid race condition in EINTR checking Even if we timeout while getting an EINTR, we'll retry epoll_wait() with a zero timeout like IO.select does in Ruby to avoid raising Errno::EINTR. commit 96503a9d386e422ee594f8579a5a76e970c90a6c Author: Eric Wong Date: Fri May 20 17:15:19 2011 -0700 sleepy_penguin 3.0.0 Epoll#wait always waits the specified amount of time and never raises Errno::EINTR. Disabled operations on Fixnum file descriptors, only IO objects may be passed to Epoll methods. Cross-thread Epoll#close behavior matches Ruby 1.9.3dev. Improved Rubinius support (lightly tested). commit d4349fce53e8ced815cb94b5e5397ff8dbf497d5 Author: Eric Wong Date: Thu May 19 16:38:47 2011 -0700 test: fix some warnings from 1.9.3dev commit 400bd0afa9f99ad657065060db50df65b843030d Author: Eric Wong Date: Thu May 19 16:38:36 2011 -0700 update to the latest pkg.mk commit 31cc74df479cd30883bbc58193c383a51d3eb57a Author: Eric Wong Date: Thu May 19 23:03:30 2011 +0000 .document: remove duplicate init.c entry commit ef934630bcc0af50fec6283b8af767e5d2fc664d Author: Eric Wong Date: Thu May 19 23:01:09 2011 +0000 disable operations on Fixnum file descriptors It's too dangerous in the general case to support, and we doubt people ever used it. commit ff020c21f772debbb1a1b247b11325c747288fcb Author: Eric Wong Date: Thu May 19 22:43:18 2011 +0000 better handle cross-thread close under Ruby 1.9.3 We don't want to operate on improper FDs in multithreaded environment. This affects MRI despite the GVL since file descriptors are usually allocated without the GVL held (open()/accept()). commit b9b8de52999d6f933f0a21f671fbf8c8f53979c0 Author: Eric Wong Date: Thu May 19 22:15:30 2011 +0000 doc: Epoll::IO should NEVER be used directly Really, don't do it. commit bd74c6f08ed98d9cc428aee1411078fbe001425b Author: Eric Wong Date: Thu May 19 22:09:06 2011 +0000 signalfd: dis-recommend this class It's too incompatible with the way Ruby handles signals. commit 6d61241b5ce1e3baefcbd3379241f55c2af8fa1b Author: Eric Wong Date: Thu May 19 21:58:55 2011 +0000 use rb_call_super instead of calling for_fd It's fewer lines of code and cleaner in cases where "new" and "for_fd" are the same underlying method. commit 6fd281b29e0e4220719e736bff4ef6d5feb49056 Author: Eric Wong Date: Thu May 19 21:39:21 2011 +0000 epoll.c: more descriptive IOError for closed descriptors Makes error reporting easier, we think. commit a7fbbbef336e79682af4ddf5365aa89c78b98126 Author: Eric Wong Date: Thu May 19 21:13:51 2011 +0000 Epoll#wait does not expose EINTR to user It's more consistent with IO#read/IO#write/IO.select in MRI. commit c41c94fd1a7d3c4c92ffc81c8816e629bfa3d8a6 Author: Eric Wong Date: Sun May 15 00:33:04 2011 +0000 epoll -signal commit 6df27bca6c4aba321ee24e4dacfa507e1deaac73 Author: Eric Wong Date: Thu May 19 20:38:37 2011 +0000 inotify: hold GVL on close We should get this fixed properly in MRI, and Inotify descriptors aren't often closed anyways... commit d2c4e8411bb86547d2957f692a0012aab5be358b Author: Eric Wong Date: Thu May 19 20:37:01 2011 +0000 epoll: close notifies other threads under MRI rb_thread_fd_close is in both MRI 1.8 and MRI 1.9.3dev commit 8fe919a1c0f273aca4a4274a3f4c92a21886ad86 Author: Eric Wong Date: Thu May 19 20:26:16 2011 +0000 epoll.c: note that close() never fails under Linux ref: Linux kernel sources commit 3f48e6f17214e710893ade129f55ebb736131d28 Author: Eric Wong Date: Sat May 14 23:40:15 2011 +0000 eventfd: fix 32-bit warning for ULL type Yes, people still use 32-bit machines commit b4fb19080d6ed8ad9903a888fa3b33fcb6fd1a98 Author: Eric Wong Date: Sat May 14 23:39:32 2011 +0000 eventfd: fix getvalue argv type Stupid typo :x commit 9ccccbbb0b5c524dab68a18dfd24a17c6d29df7f Author: Eric Wong Date: Wed Apr 27 11:25:09 2011 -0700 extconf: don't abort for rb_memerror and rb_io_close() May not detected properly commit 0af99fe16b3052b8235f62c50136b2dc25fc6cd2 Author: Eric Wong Date: Sun Apr 10 06:15:43 2011 +0000 epoll: better deal with cross thread close Probably not an issue under Linux commit fa661e5e53f2375c49073086dbdd166bb361ad83 Author: Eric Wong Date: Sun Apr 10 06:09:40 2011 +0000 inotify: disable GVL-releasing close for 1.9.3dev Ruby 1.9.3 will release the GVL for IO#close commit 7e77698bffc73032e0cbc8e1179d627a3356572a Author: Eric Wong Date: Wed Mar 9 21:08:19 2011 -0800 pkg.mk: misc updates commit cdebfac019b5e771f7babc5646a3c7961729eaca Author: Eric Wong Date: Thu Mar 10 04:35:41 2011 +0000 sleepy_penguin 2.0.0 There are many internal cleanups, bugfixes, and incompatible API changes. The API will probably be stable from now on. All the flag passing is less verbose, in the past you had to do: tfd = TimerFD.new(TimerFD::CLOEXEC|TimerFD::NONBLOCK) Now, you can just do (the old way still works): tfd = TimerFD.new([:CLOEXEC, :NONBLOCK]) A SignalFD interface now exists, but is not recommended since MRI signal handling seems to conflict with it. Inotify#close no longer holds the GVL while closing the descriptor since it is an expensive operation. See git log v1.4.0..v2.0.0 for all the gory details. commit d76fe634dfb3ed40b2ff02307963ac38d731d54e Author: Eric Wong Date: Thu Mar 10 04:43:06 2011 +0000 signalfd.c: fix whitespace commit 3721229d20880694f3c5a3a7a3fa401b19c5870b Author: Eric Wong Date: Thu Mar 10 04:35:06 2011 +0000 inotify: release GVL during Inotify#close on 1.9 close(2) on inotify descriptors takes forever and a day. commit 5905791c3373cf9cd1fce4da28acf9b16f721c3a Author: Eric Wong Date: Thu Mar 10 03:28:48 2011 +0000 inotify: add Inotify#each method for yielding each event This is useful for processing events in a synchronous fashion, we think... commit 7142fa6bd85fd5a256049f158b6c29399eee7c7c Author: Eric Wong Date: Thu Mar 10 03:27:58 2011 +0000 inotify.c: fix local variable name for RDoc "in" is a keyword in Ruby and unusable as a local variable commit 02bba7d2200cb4225e50dba51d8bcc5cc6e6d677 Author: Eric Wong Date: Thu Mar 10 03:27:32 2011 +0000 README: misc updates commit 7c3447f481067ac6d25b291e206e23a6b55d78d1 Author: Eric Wong Date: Thu Mar 10 02:40:26 2011 +0000 packaging updates, remove Isolate dependency commit eb12922fdc860ce780617a3b8302cad7c6ff9666 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 signalfd: attempt to support POSIX real-time signals I know of no other way to support them in Ruby commit eab2b76b68b68e964a9b43b50fc8ea387f719f56 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 eventfd: remove "_nonblock" interfaces Instead, allow a nonblock flag to be passed to EventFD#incr and EventFD#value so it matches other interfaces. commit aa78296c346c31ca6ee0846fe7b8e6c9dd78d764 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 TimerFD#expirations takes a nonblock flag Just like Inotify#take commit ea00a29e69bcfbcaa82ac24adb9fdfefeb9cde4c Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 eventfd: test EventFD::MAX value commit 3e75c60006b42b2c4eff8c95f11c4289e8229bb1 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 eventfd: test for :SEMAPHORE semantics commit fd1509a7854d0da1227964a562a5f344bc0569b5 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 signalfd: flesh out SignalFD#take with non-blocking Not that it works well... commit 157a3ca60a1b2bdab0f26ec631dcdcdcc29dc260 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 Inotify#take releases GVL unconditionally Avoids using select(2) if we want blocking functionality on Ruby 1.9. commit 6d7785370afe03827612572bad95c6fd81f0864b Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 split out missing bits for older glibc and kernels They could be useful for other projects. commit 6ffe88ef9ca671485e0e9a174dda99ffde7611ce Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 cleanup blocking region code for 1.8 Just reuse 1.9 methods commit 7ae6845bdaf1e969d42c6ff84c847b4a3263dae4 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 test_epoll_gc: disable expensive test by default Not needed for most cases. commit 1fd99f288140556f2f02333a6e01002a77d1bfdb Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 cleanup unneeded #define shortcuts Never used anywhere commit d5af4d2738bc47f9ecc30b0900400833077f022b Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 move set_nonblock() into util.c No need to repeat it and bloat ourselves. commit 601e98fa2f89b99c7349b5c010850dd6f4efba0b Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 timerfd: hook up TimerFD#gettime Oops, it was never wired up. commit 89986c2df21b94fec21e516c0f51f3e3584f5b2e Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 test_inotify: do not check 1.9 IO constants None of our business. commit f04b6e5d6e5ad7a5144e4a01f113f24af32c8d25 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 doc: improve RDoc documentation Might as well, since it forces me to understand these interfaces, too :) commit 01d0b34524668a52261bc026b22bc74401db71b6 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 signalfd: test with sigqueue() with DL help Still doesn't work under 1.8, oh well :< commit 32bc376e494b5477b921b6d198b7aeda0c8efe12 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 rework flags passing for ease-of-use Arguments now take symbols and arrays of symbols just like the SignalFD.new method. This fixes some use of signed vs unsigned integer conversions as well. commit 39d900abaebcb82aa2f2766b692ef558d44a9349 Author: Eric Wong Date: Thu Mar 10 02:12:46 2011 +0000 remove SLEEPY_PENGUIN_VERSION constant Bad idea to rely on constants commit e29be690d10747c09aaf4839a4a5a4a0ed11729a Author: Eric Wong Date: Sun Mar 6 02:17:57 2011 +0000 add SignalFD#update! method This modifies an existing SignalFD. commit f14855b5b746c6bb6c6edb0dada2803ab60c5b94 Author: Eric Wong Date: Sun Mar 6 00:10:50 2011 +0000 signalfd: gets => take For consistency with the inotify interface commit b62672504cfed54fcfa22229e348385c5520210b Author: Eric Wong Date: Sat Mar 5 23:45:13 2011 +0000 disable epoll optimizations test if Strace::me is missing Better than failing. commit 61c072424483b9c963823e860f627ac3c67d5375 Author: Eric Wong Date: Sun Mar 6 01:01:46 2011 +0000 remove TimerFD.create, it's redundant Even though it matches timerfd_create(), TimerFD.new is more consistent with the rest of the library. commit 2706408dbeeb661eab82e0292cb004b68a13e8e1 Author: Eric Wong Date: Sun Mar 6 00:33:43 2011 +0000 inotify: some rdoc and comments commit 6a205437e7070b8476b876536b6a77e6041f288e Author: Eric Wong Date: Sat Mar 5 23:50:24 2011 +0000 inotify: use StringValueCStr for paths This will fail on '\0' bytes since it's an illegal path character. commit e3798a8591f753706280b71c99ac8d0f2cfa393b Author: Eric Wong Date: Sat Mar 5 23:34:53 2011 +0000 add SignalFD interface It's only working for Ruby 1.9 right now. commit 9a19edb46e33f1385afefa13e1758b9263fa00d2 Author: Eric Wong Date: Sat Mar 5 23:33:39 2011 +0000 add top-level SP shortcut constant Taking a hint from EM :) commit a1cd49832cf8273ad17f106a40c61a572f9e3bd5 Author: Eric Wong Date: Sat Mar 5 23:20:01 2011 +0000 eventfd.c: fixes for Ruby 1.9 Oops :X commit fd32ba797d5a3b2d404c46fd1ed89f20fc540dcc Author: Eric Wong Date: Sun Feb 6 10:55:09 2011 +0000 pkg.mk: lib/ may not always exist We could go C-only commit bba86c017d101c365c5a22b8e2b734ff7216ce56 Author: Eric Wong Date: Fri Feb 4 22:24:59 2011 +0000 sleepy_penguin 1.4.0 - Linux I/O events for Ruby * Epoll#wait: do not automatically retry on EINTR * preliminary Inotify support * Epoll.new no longer defaults to close-on-exec TODO: FANotify + SignalFD commit 4465548dd80cf779af53bbfee133f0be5f8f2791 Author: Eric Wong Date: Fri Feb 4 22:23:12 2011 +0000 TODO: update with fanotify item The fscking all notification system! commit 6b54faf7d855b7d9eb45bf437b022e2774f39826 Author: Eric Wong Date: Fri Feb 4 22:19:23 2011 +0000 bump wrongdoc dependency wrongdoc 1.5 is nicer commit 67fa5292823f4c38a35dd83c4948441ce8438d40 Author: Eric Wong Date: Fri Feb 4 22:16:07 2011 +0000 safety fix for Inotify#dup We do not want to share buffers between inotify descriptors. commit 92a666f3ff27539655e9130db16bd1587db061de Author: Eric Wong Date: Fri Feb 4 22:02:25 2011 +0000 Epoll.new does not default to close-on-exec No need to differ from other file descriptors, even though it would be better if *all* file descriptors would default to O_CLOEXEC. commit 6540be80d8dca8cf93e74273d04211c1a73a674e Author: Eric Wong Date: Fri Feb 4 22:00:29 2011 +0000 require rb_memerror and rb_io_close The latest Rubinius supports both of these as do all MRI commit 9f51099a6651d314d1ff5a435b6bc349d3472486 Author: Eric Wong Date: Fri Feb 4 21:57:45 2011 +0000 epoll.c: safer replacement function naming This can avoid confusion/conflicts in case we link with newer versions that have the missing symbols. commit 2cc41c38dc270ff764a5cc58fd81fbdacde9ff4b Author: Eric Wong Date: Fri Feb 4 10:58:40 2011 +0000 preliminary inotify support It seems to basically work... commit 7812324579b430fa604905410b506e9e88fdda55 Author: Eric Wong Date: Fri Feb 4 06:24:20 2011 +0000 quiet build warnings for older systems Harmless, but still commit 7fbb141402974a91ff925e3f303b1bc2c698b0d4 Author: Eric Wong Date: Fri Feb 4 06:21:07 2011 +0000 epoll.c: fix uninitialized fd variable Oops :x This changes/fixes some minor misbehavior. commit c02141cbfa965a19b236e4f9a09856bd2fcacca0 Author: Eric Wong Date: Fri Feb 4 06:00:20 2011 +0000 Epoll#wait: do not automatically retry on EINTR It's often used to drive event loops and EINTR should be retried by the user (like IO.select and not like IO#read_nonblock). commit 9dda070b66753e04a179e0cd36d1eff29195a7cb Author: Eric Wong Date: Wed Feb 2 18:29:09 2011 -0800 pkg.mk: use RbConfig instead of Config Config is deprecated commit fecdb9a57523cd2d38fc76fa8609388712aa075e Author: Eric Wong Date: Thu Jan 27 21:45:06 2011 +0000 pkg.mk: allow WRONGDOC variable to be overriden This makes life easier for the wrongdoc package itself commit 01e7012f27109295f7cc158f561091b07b831762 Author: Eric Wong Date: Thu Jan 27 06:18:35 2011 +0000 pkg.mk: update in case we get rid of C ext commit 2c3c2b788c89b1ede5445bc930dd9dbb9a658c50 Author: Eric Wong Date: Fri Jan 21 16:51:23 2011 -0800 sleepy_penguin 1.3.1 - safety checks for delete One bugfix for Epoll#delete: Eric Wong (1): safer closed checks for proxied objects commit 6ba38eee337821cebcf9a7b15fcbf4622a06b78d Author: Eric Wong Date: Fri Jan 21 16:49:50 2011 -0800 safer closed checks for proxied objects Proxied objects may not be IOs at all, so have type-dependent checks to ensure they're closed. commit 6c39a46da8be194ca5069cd66ad9153f2ba09139 Author: Eric Wong Date: Fri Jan 21 14:59:08 2011 -0800 sleepy_penguin 1.3.0 - incremental improvements This release introduces compatibility with pre-EPOLLRDHUP systems. It also optimizes syscalls away for Epoll#set and Epoll#delete. Epoll#add, Epoll#mod and Epoll#del should no longer be needed in most code. commit 389c3b0d5c9d7b07de03dc76f143a3d036c30146 Author: Eric Wong Date: Fri Jan 21 13:05:25 2011 -0800 git.bogomips.org => bogomips.org Shortening URLs to save precious bytes! commit d1260beab708dea69d6a1e949089fef1de3b791d Author: Eric Wong Date: Fri Jan 21 11:40:55 2011 -0800 epoll: rdoc updates commit d65668ffdbb7319e6102214e92d83a60daaf4e1f Author: Eric Wong Date: Wed Jan 19 14:53:37 2011 -0800 move common packaging tasks into pkg.mk Makes it easier to share common code between projects and still use sh/make instead of Ruby :P commit ba49af7c89fabf87c8ea37d67dcdb8b74a1a344f Author: Eric Wong Date: Wed Jan 19 12:57:42 2011 -0800 use wrongdoc for URLs in Rakefile and gemspec Trying to be DRY, but we're sleepy and drool a lot commit 049ceab1d303105bf45951e00437af8979049204 Author: Eric Wong Date: Wed Jan 19 12:57:19 2011 -0800 GNUmakefile: fix manifest target commit bb4d312aedaa13548e5467512432b9a16b541a61 Author: Eric Wong Date: Tue Jan 18 10:06:42 2011 +0000 epoll: add a note about CLOCK_MONOTONIC for 1.8 We won't be spending too much time on 1.8 support anymore. commit e6ad2154a726795fd246bede8341c4fcfe28e1a8 Author: Eric Wong Date: Mon Jan 17 08:02:27 2011 +0000 epoll: add cache/mark array debugging methods Occasionally users may want a way to check if they stored an IO object or not, this makes it easier. commit 108d72b69f59d1c373981149c2a259bba3ff9dce Author: Eric Wong Date: Mon Jan 17 07:50:42 2011 +0000 use FIX2INT when we know we have a FIXNUM It's slightly faster commit 1c83e424e9bf80ff428a0c66332bb2318d70bd25 Author: Eric Wong Date: Mon Jan 17 07:42:55 2011 +0000 use flag cache and marks array to optimize away syscalls We can have simplify user code by caching flags and using the GC mark array to avoid syscalls and unnecessary errors/exceptions. commit 8a5fc89a0d84fe9f35f3afa207762b783f673df2 Author: Eric Wong Date: Sun Jan 16 05:09:57 2011 +0000 lazily initialize the mark array We don't want to end up accidentally splitting arrays for the same epoll file descriptor since they'll be linked. commit 7e3fa56ad3078fd980f12acf6d1344582a9aafef Author: Eric Wong Date: Sat Jan 15 13:12:17 2011 -0800 epoll: deal with missing EPOLLRDHUP on older systems Out-dated "enterprise" distros suck :P commit 743560f8af768a65e6f286fecf80b6ebd91be812 Author: Eric Wong Date: Sat Jan 15 11:54:15 2011 +0000 sleepy_penguin 1.2.0 - epoll GC help One convenience fix: epoll: prevent IO objects from getting GC-ed Users of our code may forget to keep references for their IO objects at all, and since it's not possible for GC to mark kernel memory, we just hold on to the IO objects for them. We can't unmark close()d file descriptors, ever, so we don't bother with the EPOLL_CTL_DEL case, either. Just storing IO objects in an array using the raw descriptor as a key will allow bounded space usage just like the in-kernel FD tables as long as the user remembers to close descriptors themselves. commit 681c7b02f1e1d9ca70a5748ef986361840746c3d Author: Eric Wong Date: Sat Jan 15 11:46:13 2011 +0000 epoll: prevent IO objects from getting GC-ed Users of our code may forget to keep references for their IO objects at all, and since it's not possible for GC to mark kernel memory, we just hold on to the IO objects for them. We can't unmark close()d file descriptors, ever, so we don't bother with the EPOLL_CTL_DEL case, either. Just storing IO objects in an array using the raw descriptor as a key will allow bounded space usage just like the in-kernel FD tables as long as the user remembers to close descriptors themselves. commit ab4f1a27e5d2c1688a33870b6d070aaa510ccdbc Author: Eric Wong Date: Thu Jan 13 14:26:58 2011 -0800 sleepy_penguin 1.1.1 - soft feathers, soft delete SleepyPenguin::Epoll#delete method added for "soft" failures Documentation updates and cleanups, the website is now JavaScript-free! (Ignore the 1.1.0 "release", it was a lie) commit f1729b7dfcf9b77e68d27304bfd7324724d43989 Author: Eric Wong Date: Thu Jan 13 14:35:42 2011 -0800 packaging fixups, oops Ugh, release got fat-fingered :< commit 7702d83a9a090ae73ace947be807f3f740b9d770 Author: Eric Wong Date: Thu Jan 13 14:26:58 2011 -0800 sleepy_penguin 1.1.0 - soft feathers, soft delete SleepyPenguin::Epoll#delete method added for "soft" failures Documentation updates and cleanups, the website is now JavaScript-free! commit a29b597e57cfcdf6a25cb4e8c12094e059833878 Author: Eric Wong Date: Thu Jan 13 14:25:27 2011 -0800 epoll: add "delete" for soft failures No need to burden applications. commit 9c44f01af3538fa51eeecd4944cca0ae1bc885b1 Author: Eric Wong Date: Thu Jan 13 14:09:26 2011 -0800 minor doc updates, use wrongdoc Switch documentation over to wrongdoc, no more JavaScript! Our documentation still sucks. commit 4e7fdc58a9ce5b3be5f4213ff4d2fbefac7b5cc5 Author: Eric Wong Date: Thu Jan 13 13:59:56 2011 -0800 test_epoll: redundant, redefined method, oops! commit f8a85cee27e4344783d560810a1a51dd43d5a92d Author: Eric Wong Date: Thu Jan 13 13:52:30 2011 -0800 extconf.rb: remove unnecessary dir_config We do not depend on external libraries other than the system C library commit 942e89550795316b01430c3d278c9d8ef20cc617 Author: Eric Wong Date: Mon Sep 27 17:21:46 2010 -0700 README: update summary It seems to make more sense this way... Editors wanted :) commit 97e9a7e764f912fddea75409dd388eaf3abe6a73 Author: Eric Wong Date: Sun Sep 26 06:29:09 2010 +0000 update documentation and build Should be ready for release commit 29bbb053277e9c054f1433c66a2e83ada44a5e8d Author: Eric Wong Date: Sun Sep 26 06:01:23 2010 +0000 test_epoll: workaround less aggressive GC in rbx Some of the GC tests aren't realistic, but if they work in MRI then we can expect them to work reasonably well everywhere. commit 43124e76e219d0be968fdeb09f6389d6895b0caf Author: Eric Wong Date: Sun Sep 26 06:00:10 2010 +0000 provide rb_io_close() for Rubinius Rubinius 1.1.1 does not include this function ref: http://github.com/evanphx/rubinius/issues/497 commit f3fd4447b650e75f48ac0fb9bada9b411c4b89cd Author: Eric Wong Date: Sun Sep 26 05:50:24 2010 +0000 epoll: fix typo for rb_memerror() Tested on Rubinius. commit 63b5fa10ae2f196f392bc6a9360ed2343215ce78 Author: Eric Wong Date: Sun Sep 26 04:00:30 2010 +0000 misc documentation updates We shall release without SignalFD support commit 1ad58cb0fd9045b8fa26b85d68ddf2eb06827dd3 Author: Eric Wong Date: Thu Sep 23 05:25:54 2010 +0000 wire up EventFD class This wraps the eventfd(2) interface of Linux. Like TimerFD, it is not available on older distributions. commit 2d5886698c3f7241ab23771c2876b985708ded40 Author: Eric Wong Date: Mon Sep 20 16:49:57 2010 +0000 add TimerFD class This wraps the timerfd_* interface in the Linux kernel. It is not available on older distributions. commit 4a9ce0319f6e0250c4a8e01284fd5684936bde21 Author: Eric Wong Date: Sun Sep 26 03:49:14 2010 +0000 epoll: add cross-thread test/example This can potentially be very powerful under 1.9 with native threads commit 96dad9948d3a7b181d50a9fcb35320677edc352b Author: Eric Wong Date: Sun Sep 26 03:48:50 2010 +0000 epoll: fix MRI 1.8 build It was just st.h in the old days. commit a226d237666728ea9242f6079b2c76528d53cdb2 Author: Eric Wong Date: Sun Sep 26 02:46:51 2010 +0000 Epoll#dup and Epoll#clone inherit close-on-exec There can be ways (in the future) where supporting Epoll#dup/Epoll#clone can proveuseful, so continue to support them until proven otherwise. commit 3ca3a23d3e68f62af6d57cf22825b2751c226fff Author: Eric Wong Date: Sun Sep 26 02:12:15 2010 +0000 simplify epoll_create1 wrapper There are no FD flags besides FD_CLOEXEC, so there's no point in making an extra fcntl() call. commit 43153f218e14cad3a2c6f4056fcf02dc49dc4b36 Author: Eric Wong Date: Sun Sep 26 01:41:47 2010 +0000 epoll: add fork protection It's dangerous to preserve epoll descriptors across fork, especially in Ruby where the GC can invalidate objects at any time. Installing pthread_atfork hooks prevents VALUE references stored in the kernel from leaking across process boundaries, making it far more difficult for a sanely written application to leak invalid VALUEs to the user. commit 81d66a794338e241e00b9ffd66fc94b80064475d Author: Eric Wong Date: Sat Sep 25 20:32:32 2010 +0000 Epoll#del only takes one argument We don't have to emulate the C API exactly, and it makes life saner/easier for our users. commit bc4aaf4afdfb42ad5cc5e0729f816fbefb3d338e Author: Eric Wong Date: Sat Sep 25 20:08:18 2010 +0000 epoll: factor out event data packing/unpacking Storing Ruby object values in the kernel means they won't be visible to the GC, but for the most part it's safe. commit 6296604742ed27ede171dad28f7d2bec2092d122 Author: Eric Wong Date: Sat Sep 25 19:27:09 2010 +0000 tests for EPOLLET and EINPROGRESS Just to make sure edge-triggering works on newly created TCP connections. commit e9e91bd9b9c571e9f3374a4b5aa44573f60c3d32 Author: Eric Wong Date: Sat Aug 21 09:00:57 2010 +0000 extconf: enable detection of {timer,signal,event}fd.h commit 7f841e560fae9406192994df352bfb902b2ebbe8 Author: Eric Wong Date: Sat Aug 21 09:00:42 2010 +0000 README: clarify that we're a Ruby library commit 133a7dad4b2179093e5bbb7db6db6c31a51817b7 Author: Eric Wong Date: Sat Aug 21 08:44:08 2010 +0000 initial - epoll support working