This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
RE: Thread.interrupt()
- To: "'Miles Sabin'" <msabin at cromwellmedia dot co dot uk>
- Subject: RE: Thread.interrupt()
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Wed, 15 Mar 2000 12:53:15 -0800
- Cc: "'java-discuss at sourceware dot cygnus dot com'" <java-discuss at sourceware dot cygnus dot com>
[Miles Sabin wrote:]
>Boehm, Hans wrote,
>> The crucial problem with this is that at least every class in
>> the system that performs blocking I/O has to play by these
>> rules.
>
>The same applies to Thread.interrupt().
>
>Interrupts can be cleared or deferred indefinitely, so Thread.
>interrupt() isn't a guaranteed way of cancelling a thread which
>doesn't respect the protocol.
Right. But I think there is a general expectation that library
routines shouldn't defer interrupts indefinitely or ignore them.
And I would expect that most existing libaries abide by these rules.
(And most of those that ignore the issue probably don't behave too badly
with respect to this protocol.)
In the case of resource invocation, there is no defined protocol, and
thus essentially no libraries that abide by it.
Hans