Date | Commit message (Collapse) |
|
|
|
Gah, so similar to the homepage URL...
|
|
This is still installed by Ruby, but in case one day it isn't,
we'll be ready.
|
|
We no longer have a ChangeLog, prefer to use powerful version
control instead.
|
|
In case I'm hit by a bus before the FSF releases the LGPLv4,
users may choose to use any newer version of the LGPL.
|
|
The public-inbox + mlmmj setup on bogomips.org allows posting
without subscription and offers downloadable archives via git.
The lack of rsyncable archives on librelist nowadays and
subscription-required nature of librelist are points against it.
Repliers are now encouraged to Cc: all recipients (using the
reply-all function of their mail client) since many readers are
not subscribed.
This project has never accepted or encouraged HTML email, but
librelist accepted it. The bogomips.org mail server is
configured to treat HTML mail as spam, so do not send HTML mail
if you expect a response.
Users who wish to subscribe may send a message to:
sleepy-penguin+subscribe@bogomips.org
Similarly, they may unsubscribe via:
sleepy-penguin+unsubscribe@bogomips.org
HTTP archives are available via:
http://bogomips.org/sleepy-penguin/
ssoma users may also use: git://bogomips.org/sleepy-penguin
(see README change)
Old messages to the librelist addresses will continue to
get routed to the new mailing list.
ref: http://public-inbox.org/
|
|
wrongdoc was difficult to maintain because of the tidy-ffi
dependency and the HTML5 changes in Darkfish could not be
handled well by Tidy.
olddoc is superior as it generates leaner HTML which loads faster,
requires less scrolling and less processing power to render.
Aesthetic comparisons are subjective of course but completely
unimportant compared to speed and accessibility.
The presence of images and CSS on the old (Darkfish-based) site
probably set unreasonable expectations as to my ability and
willingness to view such things. No more, the new website is
entirely simple HTML which renders well with even the wimpiest
browser (hell, olddoc even tries to generate readable raw HTML).
ref: http://80x24.org/olddoc/
|
|
We'll prefer using rb_str_new2 instead of rb_str_new(...,strlen)
to save binary size. While we're at it, explain why we cannot
take e->len into account for plain-old rb_str_new.
|
|
Many systems have inotify_init1 nowadays, so use inotify_init1
if it is available to avoid unnecessary syscalls.
|
|
Ugh, unfortunately this seems buggy in some cases, but we
need to ensure the regular case works.
ref: https://lkml.org/lkml/2007/7/9/3
Subject: inotify_rm_watch() EINVAL race condition for deleted files
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
https://github.com/rubinius/rubinius/issues/2771
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
This makes our code slightly smaller on Ruby 1.9+
|
|
RAA is dead
|
|
This is already defined for most (if not all) Rubies when ruby.h
is included.
|
|
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.
|
|
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.
|
|
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 <normalperson@yhbt.net>
|
|
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.
|
|
Oops, the lack of this header prevented gems from being
built + installed properly.
|
|
A subclass may want to set CLOEXEC by default.
|
|
This allows the Ruby-visible constant to always be up-to-date
with the release.
|
|
We support kqueue and Rubinius. Nowadays, we also export
the potentially dangerous low-level APIs for epoll and kqueue.
|
|
We need to ensure Kqueue::IO remains IO-like
|
|
The underlying kevent() itself already bypasses the timeout
if nevents==0 (so it is impossible to emulate a sleep function
with kevent()).
|
|
Hopefully this will lead to less confusion among new
users.
|
|
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.
|
|
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.
|
|
This allows the heap to reclaim memory sooner (than waiting for
GC), lowering memory usage and perhaps speeding up future
allocations.
|
|
Frequently sending signals can lead to high memory usage and
slowdowns on some Ruby + malloc implementations.
|
|
We want to avoid closing the descriptor while the thread
is running.
|
|
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
|
|
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.
|
|
The high-level kqueue class is not usable without IO#autoclose
|
|
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.
|
|
Threads do not seem safe to start inside signal handlers on
Matz Ruby 1.8
|
|
Having a timeout does not make sense if not retrieving events,
so avoid potentially triggering bugs or strange behavior between
different kqueue implementations.
|
|
This test failed on overloaded systems (and may still fail)
Unfortunately timers are hard to test as system latency
must be taken into account.
|
|
This is not _my_ common use case, but some people may
want to fetch multiple events at once.
|
|
It's good to cleanup after ourselves.
|
|
We need to validate the underlying IO object before using
it in a forked child.
|
|
It's generally unsafe to sleep inside a signal handler, and
seems to cause intermittent test failures.
|