ChangeLog from bogomips.org/sleepy_penguin.git
commit 3d8e66dfec175de1f402ef9b77c018c6d437fca1
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Fri Apr 12 19:57:47 2013 +0000
.gitignore: add .rbx
Rubinius drops this directory on us nowadays
commit 486cafa9da2dcaf988d9ecdf1b407c7e876a0217
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Jun 16 07:45:40 2011 +0000
fix unused variable warnings
Oops...
commit e71c6f4f4a79ae6d21a0da1a767af2ed168df0f3
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu May 19 16:38:47 2011 -0700
test: fix some warnings from 1.9.3dev
commit 400bd0afa9f99ad657065060db50df65b843030d
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu May 19 16:38:36 2011 -0700
update to the latest pkg.mk
commit 31cc74df479cd30883bbc58193c383a51d3eb57a
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu May 19 23:03:30 2011 +0000
.document: remove duplicate init.c entry
commit ef934630bcc0af50fec6283b8af767e5d2fc664d
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Sun May 15 00:33:04 2011 +0000
epoll -signal
commit 6df27bca6c4aba321ee24e4dacfa507e1deaac73
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Sat May 14 23:39:32 2011 +0000
eventfd: fix getvalue argv type
Stupid typo :x
commit 9ccccbbb0b5c524dab68a18dfd24a17c6d29df7f
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Wed Mar 9 21:08:19 2011 -0800
pkg.mk: misc updates
commit cdebfac019b5e771f7babc5646a3c7961729eaca
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Mar 10 04:43:06 2011 +0000
signalfd.c: fix whitespace
commit 3721229d20880694f3c5a3a7a3fa401b19c5870b
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Mar 10 03:27:32 2011 +0000
README: misc updates
commit 7c3447f481067ac6d25b291e206e23a6b55d78d1
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Mar 10 02:40:26 2011 +0000
packaging updates, remove Isolate dependency
commit eb12922fdc860ce780617a3b8302cad7c6ff9666
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Mar 10 02:12:46 2011 +0000
TimerFD#expirations takes a nonblock flag
Just like Inotify#take
commit ea00a29e69bcfbcaa82ac24adb9fdfefeb9cde4c
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Mar 10 02:12:46 2011 +0000
eventfd: test EventFD::MAX value
commit 3e75c60006b42b2c4eff8c95f11c4289e8229bb1
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Mar 10 02:12:46 2011 +0000
eventfd: test for :SEMAPHORE semantics
commit fd1509a7854d0da1227964a562a5f344bc0569b5
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Mar 10 02:12:46 2011 +0000
cleanup unneeded #define shortcuts
Never used anywhere
commit d5af4d2738bc47f9ecc30b0900400833077f022b
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
Date: Sun Mar 6 02:17:57 2011 +0000
add SignalFD#update! method
This modifies an existing SignalFD.
commit f14855b5b746c6bb6c6edb0dada2803ab60c5b94
Author: Eric Wong <e@yhbt.net>
Date: Sun Mar 6 00:10:50 2011 +0000
signalfd: gets => take
For consistency with the inotify interface
commit b62672504cfed54fcfa22229e348385c5520210b
Author: Eric Wong <e@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Sun Mar 6 00:33:43 2011 +0000
inotify: some rdoc and comments
commit 6a205437e7070b8476b876536b6a77e6041f288e
Author: Eric Wong <normalperson@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
Date: Sat Mar 5 23:20:01 2011 +0000
eventfd.c: fixes for Ruby 1.9
Oops :X
commit fd32ba797d5a3b2d404c46fd1ed89f20fc540dcc
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Fri Feb 4 22:23:12 2011 +0000
TODO: update with fanotify item
The fscking all notification system!
commit 6b54faf7d855b7d9eb45bf437b022e2774f39826
Author: Eric Wong <normalperson@yhbt.net>
Date: Fri Feb 4 22:19:23 2011 +0000
bump wrongdoc dependency
wrongdoc 1.5 is nicer
commit 67fa5292823f4c38a35dd83c4948441ce8438d40
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <e@yhbt.net>
Date: Fri Feb 4 10:58:40 2011 +0000
preliminary inotify support
It seems to basically work...
commit 7812324579b430fa604905410b506e9e88fdda55
Author: Eric Wong <e@yhbt.net>
Date: Fri Feb 4 06:24:20 2011 +0000
quiet build warnings for older systems
Harmless, but still
commit 7fbb141402974a91ff925e3f303b1bc2c698b0d4
Author: Eric Wong <e@yhbt.net>
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 <e@yhbt.net>
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 <normalperson@yhbt.net>
Date: Wed Feb 2 18:29:09 2011 -0800
pkg.mk: use RbConfig instead of Config
Config is deprecated
commit fecdb9a57523cd2d38fc76fa8609388712aa075e
Author: Eric Wong <e@yhbt.net>
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 <e@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Fri Jan 21 11:40:55 2011 -0800
epoll: rdoc updates
commit d65668ffdbb7319e6102214e92d83a60daaf4e1f
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Wed Jan 19 12:57:19 2011 -0800
GNUmakefile: fix manifest target
commit bb4d312aedaa13548e5467512432b9a16b541a61
Author: Eric Wong <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Jan 13 14:35:42 2011 -0800
packaging fixups, oops
Ugh, release got fat-fingered :<
commit 7702d83a9a090ae73ace947be807f3f740b9d770
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Thu Jan 13 13:59:56 2011 -0800
test_epoll: redundant, redefined method, oops!
commit f8a85cee27e4344783d560810a1a51dd43d5a92d
Author: Eric Wong <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <e@yhbt.net>
Date: Sun Sep 26 06:29:09 2010 +0000
update documentation and build
Should be ready for release
commit 29bbb053277e9c054f1433c66a2e83ada44a5e8d
Author: Eric Wong <e@yhbt.net>
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 <e@yhbt.net>
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 <e@yhbt.net>
Date: Sun Sep 26 05:50:24 2010 +0000
epoll: fix typo for rb_memerror()
Tested on Rubinius.
commit 63b5fa10ae2f196f392bc6a9360ed2343215ce78
Author: Eric Wong <e@yhbt.net>
Date: Sun Sep 26 04:00:30 2010 +0000
misc documentation updates
We shall release without SignalFD support
commit 1ad58cb0fd9045b8fa26b85d68ddf2eb06827dd3
Author: Eric Wong <e@yhbt.net>
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 <e@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
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 <normalperson@yhbt.net>
Date: Sat Aug 21 09:00:57 2010 +0000
extconf: enable detection of {timer,signal,event}fd.h
commit 7f841e560fae9406192994df352bfb902b2ebbe8
Author: Eric Wong <normalperson@yhbt.net>
Date: Sat Aug 21 09:00:42 2010 +0000
README: clarify that we're a Ruby library
commit 133a7dad4b2179093e5bbb7db6db6c31a51817b7
Author: Eric Wong <normalperson@yhbt.net>
Date: Sat Aug 21 08:44:08 2010 +0000
initial - epoll support working
Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.
We love to hear from you!