harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@pobox.com>
Subject Re: [Fwd: [classlib][NIO|VMI]Interruptible channel implementation - how to interact with Thread?]
Date Wed, 14 Jun 2006 11:11:46 GMT


Paulex Yang wrote:
> 
> I'm trying to complete the interruptible channel feature of NIO module,
> but there is a question.
> 
> The spec for InterruptibleChannel says:
> 
> "A channel that implements this interface is asynchronously closeable:
> If a thread is blocked in an I/O operation on an interruptible channel
> then another thread may invoke the channel's close method. This will
> cause the blocked thread to receive an AsynchronousCloseException.
> 
> A channel that implements this interface is also interruptible: If a
> thread is blocked in an I/O operation on an interruptible channel then
> another thread may invoke the blocked thread's interrupt method. *This
> will cause the channel to be closed, the blocked thread to receive a
> ClosedByInterruptException, and the blocked thread's interrupt status to
> be set. *

Why exactly would one want the channel to be closed?  This seems like
something you'd want to leave up to the thread or some other entity that
owns the channel.  I find it weird that channel lifecycle is a side
effect like this.

geir



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