I have committed some threading-related changes I'd like help testing out:
1. New logic for cross-thread events (kill, raise).
The new logic should behave better for cases of killing threads with
ensures, trying to raise in a killed thread, and two threads trying to
kill or raise in each other. It passes all tests I could find and
appears to be pretty solid. I ran test-all to completion as well as all
core and language specs.
Ideally, if there's anything wrong, it would only affect Thread#kill and
Thread#raise in any visible way, so anyone with wild threading code is
encouraged to test it against master.
2. Native timeout.rb
I finally went and reimplemented timeout.rb in a piece of Java code.
It's constructing a Java thread each time and not using a thread pool
yet, since the main perf improvement is from avoiding spinning up a
whole Ruby thread. It passes all timeout-related tests and specs I could
find and appears to function correctly.
There is one functionality change I have not decided to replicate.
timeout.rb, when given no exception to raise, constructs its own
anonymous subclass of Timeout::ExitException for each call. This is a
substantial additional overhead for every timeout invocation. The reason
for it is so that when you have multiple nested timeout calls of
different lengths, the inner call(s) doesn't intercept timeout
exceptions bound for outer call(s), since the exception types won't match.
If there are concerns about losing this behavior, I can add it back in,
ideally in a way that won't construct a whole new class every time.
- Charlie
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email