Thread.interrupt()

Boehm, Hans hans_boehm@hp.com
Wed Mar 15 12:55:00 GMT 2000


[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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /