harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject Re: [Fwd: [classlib][NIO|VMI]Interruptible channel implementation - how to interact with Thread?]
Date Thu, 15 Jun 2006 02:49:21 GMT
Hi, Archie

I have a question, please see my comment inline.

Thanks!


On 6/14/06, Archie Cobbs <archie@dellroad.org> wrote:
>
> Paulex Yang wrote:
> > Seems Thread's implementation must be aware of what operation it is
> > blocking on. So I propose the following solution:
>
> I don't think the VM or java.lang.Thread needs to be involved.
> First of all, the code performing the blocking operation knows
> what kind of operation it is, so when it wakes up abnormally it
> can take the appropriate action. This code doesn't necessarily
> reside in java.lang.Thread.


Thread A is executing a blocking operation (e.g. select) and it does
know it's blocking on select.
Then A is interrupted by Thread B. What A receives is an InterruptException.

So When and Where does Thread A take the appropriate action?

In Classpath the java.nio stuff is all implemented in native
> libraries without the VM or java.lang.Thread being specially
> "aware" of anything. However, classlib's design may be different
> enough to need it (I haven't studied it as much as you guys).
>
> E.g., the java.nio native code does invoke Thread.interrupt() and
> Thread.interrupted(), but these are normal, API-specified methods.
>
> Might be worth taking a look for some design ideas.
>
> -Archie
>
> __________________________________________________________________________
> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Andrew Zhang
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message