harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: [Fwd: [classlib][NIO|VMI]Interruptible channel implementation - how to interact with Thread?]
Date Fri, 23 Jun 2006 12:26:31 GMT
Alexander Kleymenov wrote:
> Hello,
>
> I analyzed this thread and could not find why Archie's suggestion #3
> was rejected.
> Why we should invent interrupt notification mechanism while Thread has
> method interrupted() ?.
> This method is from public API, and some interruptable operation can
> call it to get know if blocked thread was interrupted or not. And if
> the thread was interrupted, this operation acts as specified:
> "...and the thread will receive a ClosedByInterruptException"
IIRC, Archie's suggest #3 is about select interruption, so what's your 
suggestion to implement the blocking I/O interruption?

And even another time, I think maybe I need to emphasize again that the 
AbstractInterruptibleChannel/AbstractSelector must encapsulate the 
machinery about the interruption, so that it is easy for Harmony user to 
create its own interruptible channel.
>
>> Andrew Zhang wrote
>> Oh... Got it, thanks, Archie.
>> One more question: Where does these code locate? In begin/end method 
>> or main
>> body between begin/end?
>
> This code should be located in blocking operation (read() for example)
>
>> Not only Selector, SocketChannel, ServerSocketChannel but also any 
>> class who
>> extends AbstractInterruptibleChannel are interruptible channel. Any
>> interruptible channel could use begin/end to mark a blocking I/O 
>> operation.
>
> I doubt that just calling of this methods will made blocking
> operations interruptable. I.e. we should have interruption support in
> [interruptable] blocking operation anyway.
I think what Andrew said come from Java spec? Why you think the proposal 
cannot work?
>
> In the case of implementation of setInterruptAction (as Paulex
> proposed) we can fall into the problems with managing of such actions
> (multiple consequent begin()s could be an example).
I cannot see why multiple consequent begins() is a problem?
>
> Sorry if I missed something.
>
> Thank You,
> Alexander
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
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


Mime
View raw message