Hi, Archie

I have a question, please see my comment inline.

Thanks!


On 6/14/06, Archie Cobbs <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Andrew Zhang
China Software Development Lab, IBM

Reply via email to