harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Kleymenov" <kleyme...@gmail.com>
Subject Re: [Fwd: [classlib][NIO|VMI]Interruptible channel implementation - how to interact with Thread?]
Date Fri, 23 Jun 2006 09:08:29 GMT

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"

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

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

Sorry if I missed something.

Thank You,

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

View raw message