This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
RE: Thread.interrupt()
- To: java-discuss at sourceware dot cygnus dot com
- Subject: RE: Thread.interrupt()
- From: Miles Sabin <msabin at cromwellmedia dot co dot uk>
- Date: Tue, 14 Mar 2000 15:47:08 -0000
Jeff Sturm wrote,
> [snip: resource revocation as an alternative to interrupt()]
> That sounds like trading one set of underspecified behavior
> for another. I haven't tested myself this on any range of
> platforms.
Perhaps, yes. However, I would expect any robust implementation
of a stream class to respond in the Right Way to closure.
> Some stream classes are virtual, like PipedReader. It blocks
> on object.wait(). Waking it up with an interrupt would be
> easy enough. It can be made to respond to a close() as well.
It is in Sun's implementation (all the recent one's anyhow).
The alternative would be to leave either or both of the
producer/consumer threads permanently blocked ... if that
happened I'd call it a bug, independently of any issues around
interruption.
Cheers,
Miles
--
Miles Sabin Cromwell Media
Internet Systems Architect 5/6 Glenthorne Mews
+44 (0)20 8817 4030 London, W6 0LJ, England
msabin@cromwellmedia.com http://www.cromwellmedia.com/