Re: Thread#raise, Thread#kill, and timeout.rb are unsafe
On Sat, 15 Mar 2008 01:00:49 +0900, Roger Pack <rogerpack2005@gmail.com> wrote:
> It was the problems with timeout that make me wish we had an
> EnsureCritical (an Ensure that gets Thread.critical=true set to it
> before entering it), so that timeouts can end properly.
Anything using Thread.critical has its own problems, particularly
when native threads are involved. It can easily result in deadlocks
if the running thread inadvertently tries to use something which another
stopped thread is using (imagine a thread stopped halfway through
releasing a lock that the ensure block needs to acquire, for example
-- something which would have worked fine with normal use of locks, but
becomes a problem once threads can "stop the world").
-mental
|