Ruby Thread

Jul 15, 2006 12:36

I've found one thing in Ruby so far that seems akward and not at all apropriate. If an exception happens during a thread, and unless it is caught and handled within that thread the whole process will balk.
Which makes running internal threads rather risky unless you're doing all your exception handling in the immediate scope. If you have Thread.abort_on_exception=false and try to access that thread's value via #value, all you get is a printout of the exception. Can't capture it or anything, just a standard Exception#inspect.
That makes me grr angry, since you'd need to wrap your Thread blocks in {begin; thread_stuff; rescue $!; end} to get decent output.

Mutter mutter mutter.
Previous post Next post
Up