On Wed, 2007-10-24 at 19:12 -0500, Charles Oliver Nutter wrote:
> We could do that using Java thread APIs, of course, but I'm not sure the 
> best way to expose that. Perhaps an extension in the JRuby module that 
> accepts a Ruby thread and returns the actual Java thread object 
> associated with it; then we could check the real thread state to see if 
> it's blocking.
> 
> Thread.pass while JRuby.thread(t).state != Thread::State::BLOCKED

It's probably worth checking empirically, but I believe
Thread.State.BLOCKED is only used to indicate that a thread is waiting
to acquire a monitor.

IIRC this is the reason why the Scala folks resorted to watchdog
timeouts to detect threads blocked on IO in their Actors implementation
(i.e. a thread would be considered "blocked" if it didn't check in by
entering the Actor API every so many ms).

-mental

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to