MenTaLguY wrote:
On Wed, 24 Oct 2007 15:07:05 -0500, Charles Oliver Nutter <[EMAIL PROTECTED]>
wrote:
Yeah, I ran into this on other tests. The problem is that there's no
real way to determine whether a given thread is blocking on IO (that I
know of) so we can't ever be sure the thread has called accept.
I'd love to have a good solution.
Looking into it a bit, I'm surprised to find that even ThreadInfo
doesn't really have information about this. But I guess it makes
sense as the thread isn't really blocking on IO until it's in the
kernel and out of the VM's control.
I think you'd actually have to dig out a native thread ID and use
whatever native facilities there are for querying a thread's wait
state and/or tracing when it enters a blocking system call.
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
- Charlie
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email